Which of the following reserved words in Java is used to create an instance of a class?


Which of the following reserved words in Java is used to create an instance of a class?


a) class

b) public

c) public or private, either could be used

d) import

e) new

Answer: e. Explanation: The reserved word “new” is used to instantiate an object, that is, to create an instance of a class. The statement new is followed by the name of the class. This calls the class’ constructor. Example: Car x = newCar( ); will create a new instance of a Car and set the variable x to it.