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
Q9: Which of the following options declares a
Q18: What is the value inside the value
Q19: Which one of the following variables is
Q20: What will be the value inside the
Q23: Which is the Java equivalent of the
Q25: Which one of the following statements can
Q26: Which one of the following is a
Q87: What is the result of the following
Q112: Which operator is used to concatenate two
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