how can u create the object with out new operator

Answer Posted / bindhu

As my opinion, we can create object of String using 2 ways:
String s=new String("java");
String s="java";

in Other way ,we can clone an object,that will create a
new copy of an object.

or using Class.forName();( Not Sure....)

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What environment variables do I need to set on my machine in order to be able to run java programs?

597


Can a static class have a constructor?

513


Can we increase size of array?

562


How do you use compareto in java?

549


Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

499






What is defined as false sharing in the context of multithreading?

500


which pattern is default in scanner package?

1793


How do singleton patterns work?

509


How to reverse a string in java?

513


What kind of variables a class can consist of?

628


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

553


Java openings 3 - 5 years, Lnt Infotech. requirements - core java, J2ee, struts, hibernate Interview Date:- 19 March 2011 Time:- 9:00 AM to 12:00 Pm Interview Location - L & T Infotech, Manapakkam, Chennai Refererral PS NO:- 291649 (Please mention this when u fill the form only then u will be considered for interview) Documents Required:- Latest Resume, Photograph and last 3 payslips Mail me on vasan2211@gmail.com once u appear for interview

2849


what is the swingutilities.invokelater(runnable) method for? : Java thread

539


What is difference between null and void?

523


What is the simpletimezone class in java programming?

532