Mixed Questions Flashcards

1
Q

What are wrapper classes in Java?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is System class?

A

System.class is a final class provided by lava.lang package. The purpose of System class is to provide access to system resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the other name of Shallow Copy in Java?

A

Object cloning.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between Shallow copy & Deep copy?

A

Shallow copy just copies the values of the references in the class. A Deep copy copies the values of the object as well.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a singleton class?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly