1. What will be the output of the program? String x = new String("xyz"); String y = "abc"; x = x + y; How many String objects have been created?





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 02 Jun 2017 01.26 am
    Line 1 creates two, one referred to by x and the lost String "xyz". Line 2 creates one (for a total of three). Line 3 creates one more (for a total of four), the concatenated String referred to by x with a value of "xyzabc".
Show Similar Question And Answers
QA->‘I have been touring different parts of the world. During these travels, I have had the good fortune to come into contact with several saints and maharshis. But I have frankly to admit that I have never come across one who is spiritually greater than Swami Sree Narayana Guru of Kerala” Whose words are these?....
QA->Which mountain range is believed to have been formed by the wastes created by the weathering of the Aravalli Mountains?....
QA->If m = ax, n= ay and mynx = a2/z then value of xyz __....
QA->Name the translatory program which translates the high level language into machine language before running the program?....
QA->An unauthorized program which functions from inside what seems to be an authorized program, thereby concealing what it is actually doing:....
MCQ->What will be the output of the program? String x = new String("xyz"); String y = "abc"; x = x + y; How many String objects have been created?....
MCQ->Which of the following statements are correct about objects of a user-defined class called Sample? All objects of Sample class will always have exactly same data. Objects of Sample class may have same or different data. Whether objects of Sample class will have same or different data depends upon a Project Setting made in Visual Studio.NET. Conceptually, each object of Sample class will have instance data and instance member functions of the Sample class. All objects of Sample class will share one copy of member functions.....
MCQ->Which of the following statements are true about the C#.NET code snippet given below? String s1, s2; s1 = "Hi"; s2 = "Hi"; String objects cannot be created without using new. Only one object will get created. s1 and s2 both will refer to the same object. Two objects will get created, one pointed to by s1 and another pointed to by s2. s1 and s2 are references to the same object.....
MCQ->Which of the following are true about classes and struct? A class is a reference type, whereas a struct is a value type. Objects are created using new, whereas structure variables can be created either using new or without using new. A structure variable will always be created slower than an object. A structure variable will die when it goes out of scope. An object will die when it goes out of scope.....
MCQ->What will be the output of the program? String x = "xyz"; x.toUpperCase(); / Line 2 / String y = x.replace('Y', 'y'); y = y + "abc"; System.out.println(y);....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution