Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to create an instance of a class without using "new"
operator? Plz help me out properly.Thank u.

Answer Posted / b s vidyasagar reddy

three types
1.using factory methods
NumberFormat obj = NumberFormat.getNumberInstance();
2. using newInstance() method
class c = class.forName("Employee");
Employee obj = c.newInstance();
3. using coloning:
coloning is a way to create Bitwise exactcopy of an
existing object
Employee e2=e1.clone();

Is This Answer Correct ?    32 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the difference between string, string builder, and string buffer in java?

1166


What will happen if static modifier is removed from the signature of the main method?

1012


Explain the advantages of packages in java?

966


Can singleton class be cloned?

1092


What are the types of sockets in java?

1213


What are alternatives to java serialization?

1184


Why char array is favored over string for the storage of passwords?

1139


Is a boolean 1 bit?

1121


How many types of threads are there in java?

1105


What is lazy initialization in java?

1053


What is wrapper class html?

989


What is array list in java?

1124


What is JFC?

1326


You can create a string object as string str = “abc”; why cant a button object be created as button bt = “abc”;? Explain

1049


Do I need java on my pc?

1105