Mixed Questions Flashcards
What are wrapper classes in Java?
Wrapper classes allow primitive data types to be accessed as objects. Turning a primitive to Wrapper is called Autoboxing, converting Wrapper back to primitive is called Unboxing.
What is System class?
System.class is a final class provided by lava.lang package. The purpose of System class is to provide access to system resources.
What is the other name of Shallow Copy in Java?
Object cloning.
What is the difference between Shallow copy & Deep copy?
Shallow copy just copies the values of the references in the class. A Deep copy copies the values of the object as well.
What is a singleton class?
A Singleton class in Java has maximum one instance of the class present in JVM, all the time. The constructor is written in a way that it never creates more than one object of the same class.