SCJP 6 declarations...
1
-
- Where a method takes var-args and normal params
- var-arg must be listed first
-
- I declare var-arg param with what syntax?
- type... name
-
- strictfp can only be used with
- classes and methods
-
- abstract methods cannot be marked ___ or ___
- private, final
-
- I can use the synchronized modifier only on
- methods and code blocks
-
- 3 indications of a non-abstract method
- no abstract modifier, curly braces, code between curly braces
-
- Declare an abstract method with
- signature, return type and optional throws clause
-
- Local var values
- must be initialised
-
- Local vars can be marked
- final
-
- protected members inherited by subclasses in different packages are accessi...
- only to the subclass' own subclasses
-
- Subclasses outside a protected member's package gain access
- by inheritance only
-
- protected members are accessible to
- classes in the same package and subclasses in any package
-
- default members are accessible to
- only classes in the same package
-
- I can use the dot operator to access
- members of the current class
-
- private superclass members
- are never inherited
-
- private members are accessible to
- only code in the current class
-
- public superclass members
- are always inherited
-
- public members are accessible to
- all other classes in all packages
-
- If you can't access the class
- you can't access the members
-
- Name 2 means of member access
- code in a class accesses member of another class and a subclass inherits superclass members
-
- Name access levels applicable to members
- public, private, protected and default
-
- 'Members' refers to
- methods and instance variables
-
- Interfaces cannot extend ___ or ___
- a class, implement a class or interface
-
- Interfaces can extend ___
- one or more interfaces
-
- Classes can implement ___ interfaces
- one or more
-
- Classes can extend ___
- only one class
-
- Rule for runtime exceptions in (non abstract) implementing classes
- can be declared on any interface method
-
- 2 rules for exceptions in (non abstract) implementing classes
- no new checked exceptions and no broader checked exceptions
-
- Interface constants implicitly denote what access?
- public static final
-
- Interface methods can only be
- abstract
-
- The first concrete class extending an abstract must
- implement all abstract methods
-
- Abstract classes can have what sort of methods?
- abstract and nonabstract
-
- If any methods are marked ___ then ___
- abstract, the whole class must be abstract
-
- Classes cannot be marked both
- final and abstract
-
- Name the three nonaccess class modifiers
- final, abstract and strictfp
-
- Class visibility relates to what 3 concepts re. code in a class can:
- instantiation, extention and access
-
- Classes with public access can be seen by
- classes in all packages
-
- Classes with default access can be seen
- only by classes in the same package
-
- Classes can have what types of access?
- public or default
-
- Name the four access levels
- public, protected, default and private
-
- Name the three access modifiers
- public, private and protected
-
- What classes do package and import statements effect
- all classes in a file
-
- Import statements are included where in a file
- after package statement and before class declaration