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 is recursion in java

596


Give me some null interfaces in java?

599


How do you replace a string in java?

543


Explain the use of javap tool.

630


What is temp in java?

549






When object is created and destroyed?

638


What is difference between public static and void?

480


What does sprintf return?

584


What are the different types of inner classes?

531


Which methods are used during serialization and deserialization process?

550


Explain inner classes ?

646


What is a byte string?

617


What is array and arraylist in java?

525


Which one of the following suits the description of a string better: derived or primitive?

512


What is the method in java?

594