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

Is string serializable in java?

771


Difference between vector and arraylist.

796


What are multiple inheritances?

849


Which is better arraylist or vector?

805


what is the purpose of the runtime class?

805


Which containers use a flowlayout as their default layout in java programming?

743


Which collection is best for sorting in java?

901


How to provide security in java

2027


Where are the local variables stored?

790


Can I learn java without any programming experience?

797


Explain some best practices you would apply while using collection in java?

819


What is the method overriding?

834


Explain about main thread in java?

875


How do constructors use this() and super()?

818


Explain the difference between protected and default access.

760