Java Basics Keywords

Source: Internet
Author: User
Tags goto key key words keyword list lowercase reserved java keywords
Keyword Author: matrix-stopno





Oh, no matter what else, to a few topics first, against your cow ^_^

















1, which of the following are keywords or reserved words in Java?


a) if b) then (c) Goto D) (e) Case f) sizeof





2, which of the following are Java key words?


a) Double b) Switch c) then D) instanceof





3, which of are key words in Java?


a) default B) NULL c) String D throws E) long F) True





The answer came 1,ACDE 2,ad 3,adef did it? ^_^





explained that 1,then and sizeof are not Java keywords, familiar with C or C + +, write accustomed to the master of the ASP will be careful.





2, all the keywords are lowercase, so the switch is not a keyword. Instanceof looks like a method name, but it's actually a keyword;





3, uppercase null is not a keyword in the Java language. String is the class name of a encapsulated class in the Java language and is not a keyword.





a bit more system:





It is important to correctly identify the Java language keywords (keyword) and reserved words (reserved word). Java keywords have special meaning for Java compilers, they are used to represent a data type, or to represent the structure of a program. Reserved words are keywords reserved for Java, and although they are not currently keywords, they may be used as keywords in later upgrades.





keyword list





abstract Boolean break byte


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 word


Const,goto





, pay attention
.




identify the keywords in the Java language and do not confuse them with other languages such as C + + keywords.


const and Goto are reserved words in Java.


all the keywords are lowercase


friendly,sizeof is not a Java keyword








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.