Q&A Categories
Find a Question:
Java Interview Questions and Answers
In how many ways we can create an object? Explain with example.
Answer this Question
You must be Logged In to post an Answer.
Not a member yet? Sign Up Now »
Hot Interview Questions of Java
- » What is weak reference in Java.
- » In which case would you choose a static inner class?
- » What are the different types of inner classes?
- » Can you call one constructor from another if a class has multiple constructors?
- » How to check two arrays to see if contents have the same types and contain the same elements?
Star Points Scale
Earn points for Posting and Commenting Papers!
[1 - 25
[26 - 50
[51 - 500
[501 - 5000
[5001 - 25000
[25001+
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
1
0