Correct Answer: JAR files are java's version of ZIP files In fact, JAR uses the ZIP file format uses: - to compress a number of class files into one file - to make a java executable JAR file
Correct Answer: Unwrapping is also called as unpacking or unboxing Getting the private data stored in the object by using methods is called unpacking or unwrapping
Correct Answer: Wrapping is also called as packing or boxing Storing the data inside the object as private data which can accessed outside the class only by using methods
Correct Answer: - By using method overriding a sub class can change the definition of super class method - By using overriding a sub class can modify the functionality of the super class
7. What is the use of overloading ? or why overloading?
Correct Answer: Final method is a method defined in the super class with final modifier We cannot overriding final method of super class in the sub class EX: Class Sample { final void funOne() { } void funTwo() { } } Class Sub extends Sample { void funOne() { // overriding is not allowed } viod funTwo() { //overriding is allowed } }
9. What is the purpose of overriding toString() method?
Correct Answer: If constructor opens the file finalize() method closes that file If constructor opens the connection finalize() method closes that connection To perform finalization operation we must overriding finalize method