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

Why are global variables used?

712


What is the use of generics? When was it added to the Java development Kit?

764


How do you create immutable object in java?

784


What is the old name of java?

712


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

779


What is overriding in java?

751


Differentiate storage classes on the basis of their scope?

877


Can an interface implement another interface?

778


What are Normalization Rules? Define Normalization?

766


How a variable is stored in memory?

725


How can we avoid including a header more than once?

797


Is string is a data type in java?

804


What is a ternary operator in java? What is an interface?

765


Is int primitive data type?

741


What is downcasting?

795