suppose string s1="rajnish";
string s2="bhaskar";
then what will be happend ?
Answer Posted / venkat
FIRST OF ALL THE JVM CREATED THE OBJECTS FOR STRING
CLASSESS IN TWO WAYS
1)STRING S1=NEW STRING("VENKI");
2)STRING S2="VENKI"
IN SECOND APPROACH WHEN THE JVM IS EN COUNTED THE ""
(DOUBLE QUOTATIONS) THEN IT UNDERSTOOD ,AND CREATED THE
OBJECT FOR THE S2 , AND THIS OBJECT IS PLACED IN THE STRING
POOL (SEPERATE MEMORY LOCATION IS MAINTAINED) . i.e in this
position we are not creating the object for the string class
explicitly ,the jvm internally created this object
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are the restrictions imposed on method overriding?
what is deadlock? : Java thread
Is 9 a prime number?
For ease of programming you can consider the maze as a 2D array with colors represented by below integer and characters (in capital letters). • B - Black • W -White • G- Green • R- Red R B W B W W W W W W B W B B W W W W W W W B W B W W W B W W W W B B W W W B W W W B W W B B B B W B W B W W B W W W B W W W B B B W W B W W W B W W B W B W W W B W B W W W W B B W W W W B W W W W W G Shortest Route Problem: • Solution that finds the shortest Route between Red and Green White will have 1 Weight. Red and Green carry no weights. Shortest path is the path with less weight when you add up the weights in the path.
Is minecraft 1.15 out?
What classes of exceptions may be caught by a catch clause in java programming?
What is 32 bit float?
Who found java?
What are the actions that can occur when a thread enters blocked state?
What is a Hash Table? What are the advantages of using a hash table?
What is singleton class and how can we make a class singleton?
Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.
What is the meaning of 3 dots in java?
When is the finalize() called? What is the purpose of finalization?
What is the difference between length and length () in java?