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 prefix of a string?

1030


What is the program compilation process?

1102


What is sortedset in java?

1014


How do you use substring in java?

1126


Can we declare the static variables and methods in an abstract class?

983


Can I extend singleton class in java?

1093


Which variables are stored in stack?

892


What is a java string?

1070


Can we have more than one package statement in the source file?

1048


What is set and get methods in java?

965


Can we have 2 main methods in java class?

1015


How to display arraylist values in java?

998


What are annotations in java?

1085


What does null mean in java?

1058


Write the algorithm to check the number non-leaf nodes in a tree.

1061