What is the result?

Given:
public class MyClass {
public static void main(String[] args) {
String s = " Java Duke ";
int len = s.trim().length();
System.out.print(len);
}
}
What is the result?
A. 8
B. 9
C. 11
D. 10
E. Compilation fails

Download Printable PDF. VALID exam to help you PASS.

One thought on “What is the result?

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.