1).what is the difference between below examples

String s="vijay";

String s=new String("vijay");

Answer Posted / p.sreekiran

in first string class it create in heep memory and second
is created object in constant memeory we cannot change the
second one

Is This Answer Correct ?    2 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the default size of arraylist in java?

500


What are disadvantages of java?

517


Is arraylist a class in java?

530


What is internal iteration in java se 8?

625


Do I need to import java.lang package any time? Why?

737






What is difference between identifier and variable?

468


What is the purpose of the file class in java programming?

525


When we should use serialization?

564


How to overcome the exception object reference not set to an instance of object?

616


Explain the selection sort algorithm and state its time complexity?

603


What's the difference between an abstract class and interface in java?

553


Write a factorial program using recursion in java?

512


Write a function for palindrome and factorial and explain?

654


Can you declare the main method as final?

523


Can final class have constructor?

497