Course List: http://www.c-jump.com/bcc/

Inheritance


  1. Inheritance
  2. Swing Forms Hierarchy
  3. The Object class
  4. The equals( ) method
  5. The finalaize( ) method
  6. Methods of the Object class
  7. Member Access Modifiers
  8. An annotation for overriding a method
  9. Case Study: Product Database
  10. Data Attributes and Class Candidates
  11. The syntax for creating subclasses
  12. The Class class
  13. Access to object's type
  14. The equals( ) method
  15. The equals( ) method override
  16. Abstract Classes
  17. An abstract Product class
  18. Concrete class
  19. The final modifier
  20. A final class example
  21. A final method example
  22. A final parameter example

1. Inheritance



2. Swing Forms Hierarchy



3. The Object class



4. The equals( ) method



5. The finalaize( ) method



6. Methods of the Object class



7. Member Access Modifiers



8. An annotation for overriding a method



9. Case Study: Product Database



10. Data Attributes and Class Candidates



11. The syntax for creating subclasses



12. The Class class



13. Access to object's type

  • Code that tests an object's type:

    
        Product p = new Book();  // create a Book object
        if ( p.getClass().getName().equals("Book") ) {
            System.out.println("This is a Book object");
        }
    
    

    The console output:

    
        This is a Book object
    
    
  • An easier way to test an object's type:

    
        Product p = new Book();  // create a Book object
        if ( p instanceof Book ) {
            System.out.println("This is a Book object");
        }
    
    
  • The console output:

    
        This is a Book object
    
    

14. The equals( ) method



15. The equals( ) method override



16. Abstract Classes



17. An abstract Product class



18. Concrete class



19. The final modifier



20. A final class example



21. A final method example



22. A final parameter example