DEFINITION Java IDE created by Xinox Software JCreator
DEFINITION • Java IDE created by Xinox Software • JCreator is a powerful interactive development environment (IDE) for Java technologies. • A Java compiler
TOKENS • characters that are grouped into symbols
DIFFERENT TYPES OF TOKEN
• SYNTAX ü characters and symbols and their structure used to code the class using Unicode characters.
• IDENTIFIERS ü non keywords üprimarily they are used as names
LEGAL ILLEGAL 1. The first character of the identifier should start either with a letter, a currency character ( $ ), or a connecting character like underscore( _ ). 2. The first character maybe followed by either or a combination of letters, currency characters, connection characters, or numbers. 3. There is no limit of how many characters an identifier can contain. However, it's essentially recommended to use a short character identifier yet readable and understandable. 1. Identifiers that starts with a number. 2. Using Java keywords as an identifier is illegal. In other words, you can't use a Java keyword as an identifier Note: More importantly, keep in mind that Java Identifier are case sensitive. Thereby, NAME and name are two different identifiers.
Here are some hint on how to formulate identifier name: • Classes & Interface - The first letter should be capitalized. If the desired name is composed of several words, the first letter of the inner word should be capitalized (camel. Case). For example: Chair, Information. Department and Head. Office. • Methods - The first letter should be lowecase, and then camel. Case rules should be applied. Also, take note that in method names should be verb-noun pairs. For example: get. Total, set. Contact. Number and buy. Cellphone.
Here are some hint on how to formulate Identifier name: • Variables - same rules apply on letter case with methods. However, it should idially be a short and meaningful. For example: first. Name, current. Location and total. Price. • Constants - Java constants should be named using uppercase letters with underscore characters as separator. Take note that constants are created by marking variables as static and final. For example: PERSON_LABEL, HELLO_MESSAGE and GREETING.
• LITERALS ü represent numbers üA constant value which can be assigned to a variable E. g: int x=10, int x=010 • STRING LITERALS üof zero or more characters embedded in double quotes E. g: String s=” laxman scjp”;
• OPERATORS ü + and = are used to express basic computation such as addition or String concatenation or assignment.
• BLOCKS ü left and right braces ({ and }) übody of a class
• WHITESPACE ü such as spaces, tabs, and newlines üseparate tokens
• COMMENTS /* text */ The compiler ignores everything from /* to */. /** documentation */ This indicates a documentation comment (doc comment, for short). // text The compiler ignores everything from // to the end of the line.
- Slides: 15