| Author |
Ways to create an object?
|
Kaustubh G Sharma
Ranch Hand
Joined: May 13, 2010
Posts: 1160
|
|
How many ways we can create an object in java 3 of them i know..
1. new keyword
2. deserialization
3. class.forName()
any other way out?
kaustubh
|
No Kaustubh No Fun, Know Kaustubh Know Fun..
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
|
Class#forName does not create new instances. Class#newInstance does.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12953
|
|
This question is asked regularly on the forums here. Is this some standard job interview question that a lot of people get asked?
differnt ways to create object for a class
How many ways can we create an object?
Interview question
object
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: Ways to create an object?
|
|
|