Solved

Assuming That the User Enters 45 and 62 as Inputs

Question 22

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents