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 is a short in java?

1048


What kind of variables can a class consist?

1060


What is meant by vector class, dictionary class, hash table class, and property class?

1158


explain autoboxing in java?

1008


What are the types of sockets in java?

1153


What is operator overloading. Is it is supported in java?

1030


What is Applet Stub Interface ?

2495


What is java abstraction with example?

1069


Is there any difference between nested classes and inner classes?

1098


Is void a keyword in java?

1019


Can list be final in java?

933


Can static methods access instance variables in java?

1087


What steps are taken when the OS shifts from one-thread execution to another?

1367


What is set and get methods in java?

977


Can constructor be synchronized?

941