Java & OO Intermediate - Part 2

Inheritance
  • Given a class hierarchy, identify parents and children
  • Use the correct Java syntax for extending a class.
  • Write expressions that upcast or downcast a reference (no tricks, no arrays).
Object
  • Know that java.lang.Object is the ultimate ancestor.
  • Identify methods inherited from the Object class.
  • Write correct implementation of the toString() method.
Overriding
  • Explain the overriding mechanism and late binding
  • From given code including a late binding call, predict the method that will be called.
  • Identify correct overriding syntax, distinguish between the overriding and overloading mechanism.
Abstract
  • Write code that declares abstract classes and methods
  • Understand that an abstract class cannot be instantiated
  • Know that once a class contains an abstract method, it must be marked as abstract.
Interfaces
  • Write code that declares an interface and its containing methods.
  • Make a class implement an interface correctly.
  • Explain the particular nature of attributes declared in interfaces.
  • Identify differences between implementing an interface and extending a class.
  • Know that all methods of an interface are public.

instanceof
  • Write code that uses the instanceof operator for run-time type identification.
  • Identify correct operands of the instanceof operator
Access modifiers
  • From a given situation, predict if a method can access a class attributes/methods, whatever of the 4 access modifiers are applied on these attributes/methods.
  • Select the appropriate access modifier to enable a class to access or not access an attribute/method.
Overloading
  • Implement constructor an method overloading correctly.
  • Know that two methods cannot differ only on the return type.
Annotation
  • Use the @Override annotation

你可能感兴趣的:(java,OO,Access)