In below given cases, in which case the string “carrerride” is saved in string constant pool?
i)String s=”carrerride”;
ii)String s=new String(“carreride”);

Options
- only i
- only ii
- Both i and ii
- None


CORRECT ANSWER : only i

Discussion Board
regrds Answer

Answer will be Both i and ii
becz when ever String s=new String("carreride") will encountered two obj will be created one in heap and second in string constant pool







mukesh kumar ray 10-9-2014 02:56 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement