Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
5 Cards in this Set
- Front
- Back
Identifiers (Objective 1.3)
|
* Identifiers can begin with a letter, an underscore, or a currency character.
* After the first character, identifiers can also include digits. * Identifiers can be of any length. * JavaBeans methods must be named using camelCase, and depending on the method's purpose, must start with set, get, is, add, or remove. |
|
Declaration Rules (Objective 1.1)
|
* A source file can have only one public class.
* If the source file contains a public class, the filename must match the public class name. * A file can have only one package statement, but multiple imports. * The package statement (if any) must be the first (non-comment) line in a source file * The import statements must come between the package statement and the first class definition. * package and import statements apply to all classes in the file. * A file can have more than one nonpublic class. * Files with no public class have no naming restrictions. |
|
Class Access Modifiers (Objective 1.1)
|
* There are three access modifiers: public, protected, and private.
* There are four access levels: public, protected, default, and private. * Classes can have only public or default access. * A class with default access can be seen only by classes within the same package. * A class with public access can be seen by all classes from all packages. * Class visibility revolves around whether code in one class can: TAB- Create an instance of another class TAB- Extend another class TAB- Access members of another class |
|
Class Modifiers (Nonaccess) (Objective 1.2)
|
* Classes can also be modified with final, abstract, or strictfp.
* A class cannot be both final and abstract. * A final class cannot be subclassed. * An abstract class cannot be instantiated. * A single abstract method in a class means the whole class must be abstract. * An abstract class can have both abstract and nonabstract methods. * The first concrete class to extend an abstract class must implement all of its abstract methods. |
|
Interface Implementation (Objective 1.2)
|
* Interfaces are contracts for what a class can do, but they say nothing about the way in which the class must do it.
* Interfaces can be implemented by any class, from any inheritance tree. * An interface is like a 100% abstract class, and is implicitly abstract whether you explicitly declare it abstract or not. * An interface can have only abstract methods. * Interface methods are by default public and abstract; explicit declaration of these modifiers is optional. * Interfaces can have constants, which are always implicitly public, static, and final. * Interface constant declarations of public, static, and final are optional in any combination. * A legal nonabstract implementing class has the following properties: - It provides concrete implementations for the interface's methods. - It must follow all legal override rules for the methods it implements. - It must not declare any new checked exceptions for an implementation method. |