Declaring a Class & Creating Objects

Advertisements
Advertisements
Advertisements3
Advertisements4
Advertisements6
Advertisements66

1. Which of the following statements creates a new object from the Person class with the name “Alice”?

Ans. Person alice  = new person();

2. Which of the following is true about object creation in Java?

Ans. Objects are created by invoking a constructor on a class.

 
 

Author: Lakshmi Prasanna Ponnala

Completed M.Tech in Digital Electronics and Communication Systems.

Leave a Reply

error: Content is protected !!

Discover more from ece4uplp

Subscribe now to keep reading and get access to the full archive.

Continue reading