- Identifiers are names of variables, functions, classes etc.
- A keyword or reserved word
- Java technology supports three type of comments
- Read about full lexical structure of java
- Integer literals can also be specified as octal (base 8), or hexadecimal (base 16). Octal and hexadecimal have 0 and 0x prefix respectively. So 03 and 0x3 are representation of integer three in octal and hexa-decimal respectively.
- Java technology supports the primitive types - boolean (for representing true or false), a character type called char, four integer types (byte, short, int and long) and two floating point types (float and double). Click here for more.
- Corresponding to all the primitive type there is a wrapper class defined. These classes provide useful methods for manipulating primitive data values and objects. See here.
- Limits of these datatypes
- Default values of primary datatypes
- Variables
- A Java source file format
- The Java interpreter executes a method called main, defined in the class specified in command line arguments. The main method is the entry point for execution of a class. In Java technology the main method must have the following signature -
public static void main(String args[])
The java interpreter is invoked with the name of the class as an argument. The class name is followed by possible set of arguments for the main function of the class. When a Java program is invoked then the Java interpreter name "java" and the class name are not passed to the main() method of the class. The rest of the command line arguments are passed as an array of String. For example invokingjava Sky blue gray
would invoke main method of Sky class with an array of two elements - blue and gray.
args[0]=blue , args[1] = gray
A java blog with a collection of examples and tutorials on Java and related technologies. (Under maintenance with continuous updates) Be in touch with java jazzle or k2java.blogspot.com.
Friday, April 2, 2010
Syntax and Grammar of Java
Labels:
Class,
core-java,
java,
lexical structure,
OOP / Object Oriented Programming,
scjp,
syntax and grammar,
toc2
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment