Solved

What Does the Following Statement Sequence Print If the User

Question 66

Multiple Choice

What does the following statement sequence print if the user input is 123?
Public static void main(String[] args)
{
Scanner in = new Scanner(System.in) ;
System.out.print("Enter a number: ") ;
String str = in.next() ;
Str += 456;
System.out.println(str) ;
}


A) 579
B) Compile-time error
C) Run-time error
D) 123456

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