1).what is the difference between below examples
String s="vijay";
String s=new String("vijay");
Answer Posted / navneet raushan
the first case does: if u write first case , one object and
one refernce will be created. object will be created in
string pool.
But when u write 2nd case , two object and one refernce
will be created , one in string pool and one in heap.
Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What is the difference between private & public & friendly classes?
Where can i get Latest SUN Certification Dumps and what are the Sun Certification Codes that are available, Im new to JAVA, so please gimme info as i need to write J2EE - Core Java Certification
What is the default access specifier for variables and methods of a class?
How many bytes is 255 characters?
What will happen if static modifier is removed from the signature of the main method?
Can we override private constructor in java?
What does the “static” keyword mean?
How do you know if a value is nan?
In how many ways we can create threads in java?
How to compare two strings in java program?
What is a two-pass assembler?
what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread
Why map is used in java?
Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.
What are the types of casting?