SKILL BENCHMARK
Java Object-Oriented Programming Literacy (Beginner Level)
- 26m
- 26 questions
The Java Object-Oriented Programming Literacy benchmark measures your understanding of writing appropriate constructors, the role of the default constructor provided by Java, correct getter and setter methods, and method overloading in classes. A learner who scores high on this benchmark demonstrates they have the skills to recognize class hierarchies, work with byte and character streams in Java, and understand overriding principles.
Topics covered
- apply method overriding and recognize the concept of hiding
- apply the skip and available methods of FileInputStream objects and identify when the end of a byte stream has been reached
- apply the two ways of initializing derived classes - implement an explicit no argument constructor in the base class or use the super keyword and have only parameterized constructors in both the base and derived classes
- combine method overriding with fairly complex inheritance hierarchies
- completely and correct implement the .hashCode contract
- copy a character file as a sequence of characters using the FileReader and FileWriter classes
- copy any file as a sequence of bytes using the FileInputStream and FileOutputStream classes
- correctly override the .hashCode method and write the code to correctly override the .equals method, which is inherited from java.lang.Object
- define and invoke multiple constructors to instantiate objects of a class
- define getter and setter methods to work with access protected member variables
- describe the initialization of member variables of class objects
- identify the role of access modifiers and recognize the basics of constructors
- identify what happens when there is a base and derived class that have many different constructors
- make use of method overloading in your programs
- override the method .toString, which is inherited from java.lang.Object
- read a byte stream using the InputStream and FileInputStream classes
- read a character stream using the FileReader and FileReader classes
- recognize how static methods are bound using compile-time rather than run-time binding
- recognize how when you add your own constructor, Java takes away the default no-argument constructor it had provided
- recognize Java's class hierarchy for byte and character streams
- recognize that a base class's constructor is invoked when a derived class object is instantiated
- recognize that static methods don't support run-time polymorphism
- use advanced forms of overriding
- use the this keyword appropriately inside getter and setter methods of a class
- use the this keyword appropriately inside the constructor and other methods of a class
- write a byte stream using the OutputStream and FileOutputStream classes