GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java

 Print  |  
Question:  Object Creation

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


March 03, 2009 15:22:50 #4
 Auxilius   Member Since: March 2009    Total Comments: 1 

RE: Object Creation
 
I agree with the answer given by vishrutha with few modifications.

  • Part 2 and the last is very similar to each other.
  • Deserialization can not be called as way of object creation.
  • Clone is useful for normal objects but not for composite objects.
From the perspective of design patterns we have six ways of object creation by GoF. But that is all about design patterns. If you ever heard about singleton objects (one of the six), you should read GoF creational patterns.
     

 

Back To Question