자격증/OCJP_ExamD
QUESTION 15
IT grow.
2018. 7. 30. 00:36
반응형
QUESTION 15Given that c is a reference to a valid java.io.Console object, and:11. String pw = c.readPassword("%s", "pw: ");12. System.out.println("got " + pw);13. String name = c.readLine("%s", "name: ");14. System.out.println(" got ", name);If the user types fido when prompted for a password, and then responds bob when prompted for a name, what is the result?A. pw: got fido name: bob got bobB. pw: fido got fido name: bob got bobC. pw: got fido name: bob got bobD. pw: fido got fido name: bob got bobE. Compilation fails.F. An exception is thrown at runtime.Solution : E
plus imformation
Main.java:14: cannot find symbol
symbol : method println(java.lang.String,java.lang.String)
location: class java.io.PrintStream
System.out.println(" got ", name);
^ 1 error
더 자세히 알아 보기 : http://pracon.tistory.com/42 <-- 이링크를 통해 자세히 알아보기
반응형