Assuming that the user enters 45 and 62 as inputs for n1 and n2, respectively, what is the output of the following code snippet?
Public static void main(String[] args)
{
System.out.print("Enter a number: ") ;
Scanner in = new Scanner(System.in) ;
String n1 = in.next() ;
System.out.print("Enter another number: ") ;
String n2 = in.next() ;
String result = n1 + n2;
System.out.print(result) ;
}
A) 46
B) 4662
C) 107
D) 4562
Correct Answer:
Verified
Q4: Which one of the following refers to
Q28: Which one of the following is
Q29: Which of the following is the
Q30: Which of the following options is valid
Q31: What is the output of the following
Q32: Assuming that the user inputs a value
Q36: Assuming that the user inputs "Joe" at
Q43: What is the value of Math.abs(-2)?
A)-2
B)0
C)2
D)4
Q52: Consider the following division statements:
I.22 / 7
II.22.0
Q116: How do you compute the length of
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