Which of the following statements will create a reference, str, to the string, "Hello, world"?
(1) String str = new String("Hello, world") ;
(2) String str = "Hello, world";
A) 1
B) 2
C) 1 and 2
D) neither 1 or 2
Correct Answer:
Verified
Q28: For the following code, which statement is
Q29: A constructor is a method that:
A) returns
Q30: Instance methods do not have this key
Q31: Overloading means multiple methods in the same
Q34: After the header, the body of the
Q35: In a UML diagram to indicate the
Q37: Given the following code, what will be
Q38: This refers to the combining of data
Q41: When an object is passed as an
Q50: The scope of a public instance field
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents