Which of the following are Java keywords?
1) sizeof
2) main
3) transient
4) volatile
Answer :
3) transient
4) volatile
Option 1, sizeof is designed to catch out the C/C++ programmers. Java does not have a sizeof keyword as the size of primitives should be consistent on all Java implementations. Although a program needs a main method with the standard signature to start up it is not a keyword. The real keywords are less commonly used and therefore might not be so familiar to you.
No comments:
Post a Comment