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
Q2: A method that gets a value from
Q4: The java.lang package is automatically imported into
Q8: Instance methods do not have the key
Q13: A constructor is a method that is
Q20: Instance methods should be declared static.
Q21: This is a group of related classes.
A)
Q22: In UML diagrams, this symbol indicates that
Q31: Overloading means multiple methods in the same
Q46: An access specifier indicates how the class
Q53: The following package is automatically imported into
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