Solved

Given That S Is a String, What Does the Following

Question 14

Multiple Choice

Given that s is a String, what does the following loop do?
For (int j = s.length( ) ; j > 0; j--)
System.out.print(s.charAt(j-1) ) ;


A) it prints s out backwards
B) it prints s out forwards
C) it prints s out backwards after skipping the last character
D) it prints s out backwards but does not print the 0ᵗʰ character
E) it yields a run-time error because there is no character at s.charAt(j-1) for j = 0

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