Q&A Categories

Java Interview Questions and Answers

In how many ways we can create an object? Explain with example.

Answer #1

When we create a class, we are creating a new data type and using this type we create objects. This can be done in one way i.e. using `new` operator which dynamically allocates memory for an object and returns a reference to it.

Eg.class_name x=new class_name; 

Where, class_name is the class name and x is the object.

Agree With Answer Thumb up 1 Thumb down 0

Answers Answered By: Sajan [8 Grey Star Level]

Answer this Question

You must be Logged In to post an Answer.

Not a member yet? Sign Up Now »

Hot Interview Questions of Java

Star Points Scale

Earn points for Posting and Commenting Papers!

Grey Sta Levelr [1 - 25 Grey Star Level]
Green Star Level [26 - 50 Green Star Level]
Blue Star Level [51 - 500 Blue Star Level]
Orange Star Level [501 - 5000 Orange Star Level]
Red Star Level [5001 - 25000 Red Star Level]
Black Star Level [25001+ Black Star Level]

Invalid license.