Essential knowledge for beginners in JAVA-Keywords of Java Basics

Source: Internet
Author: User
Tags keyword list java keywords
Essential knowledge for beginners of JAVA-keywords for basic Java-general Linux technology-Linux programming and kernel information. For details, refer to the following section. Come to several questions first

1, which of the following are keywords or reserved words in java?
A) if B) then c) goto d) while e) case f) sizeofc

2, which of the following are java key words?
A) double B) Switch c) then d) instanceof

3, which of these are key words in java?
A) default B) NULL c) String d) throws e) long f) true

The answer is "1", "acde 2", "ad 3", and "adef ".

1. then and sizeof are not java keywords. If you are familiar with c or c ++, be careful when writing asp.

2. All keywords are in lower case, so Switch is not a keyword. Instanceof looks like a method name, but it is actually a keyword;

3. uppercase NULL is not a keyword in java. String is the class name of an encapsulation class in the java language, and is not a keyword.

Next, let's look at the system:

It is very important to correctly identify the keywords (keyword) and reserved words (reserved word) in java. Java keywords have special significance for java compilers. They are used to represent a data type or program structure. Reserved Words are reserved keywords for java. Although they are not currently used as keywords, they may be used as keywords in later versions.

Keyword list

Abstract boolean break byte case
Catch char class continue default
Do double else extends false
Final finally float for if
Implements import instanceof int interface
Long native new null package
Private protected public return short
Static super switch synchronized this
Throw throws transient true try
Void volatile while
  
Reserved Words
Const, goto

Notes

Identifies keywords in the java language. Do not confuse them with keywords in other languages such as c/c ++.

Const and goto are reserved words in java.
All keywords are in lowercase.
Friendly, sizeof is not a java keyword
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.