Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Which is a reserved word in the Java programming language?(choose two)
Given the following Java code:
What is the result?
A. The code compiles and “s=” is printed.
B. The code compiles and “s=null” is printed.
C. The code does not compile because string s is not initialized.
D. The code does not compile because string s can not be referenced.
E. The code complies, but a NullPointerException is thrown when toString is called.
- ΨετμουνΤLv 71 decade agoFavorite Answer
1. const and goto are Java reserved words. See Java Reserved Words.
2. Java compiler checks possible failure of initialization of all variables. Since the s is evidently not initialized, the compiler complains for good. The answer is C.