Вы находитесь на странице: 1из 4

y y y y

Java is an object-oriented programming language syntax and keywords almost identical to C++ Java is easier to learn than other objectoriented languages. When developing Java, its creators took all of the good features of the existing object-oriented programming languages such as C++, Ada, and Smalltalk, and removed most of their difficulties

y y y y y y y y

AJava program can be written once and then run on many different devices. write once, run anywhere. The exact same program can run on Windows and the Palm OS, without changing the code at all. JVMs are written in C or C++. A JIT compiler actually takes your Java bytecode and translates it into native code. This translated code will run just as fast as any C++ program. JIT compilers do all of their work in RAM Sun grouped their major Java programming technologies into three editions: o o o J2ME: Java 2 Platform, Micro Edition J2SE: Java 2 Platform, Standard Edition J2EE: Java 2 Platform, Enterprise Edition

y y y

J2SE is the core Java language. The javac tool is the Java compiler you will use to compile the Java code you write into bytecode. First Java program: o o o Write the source code. Compile the source code. Run the program.

The main() method is unique because it is the method invoked by the JVM when this program is executed.

A class is a description of an object, and an object is an instance of a class. An object consists of two major components: attributes and behaviors. The attributes of an object are what the object consists of, and the behaviors of the object are what the object does.

y y

we do not write an object in object-oriented programming (OOP); [ example for classes and objects]

y
y

After compiling we can now run the program using the java tool. The java tool requires the name of the bytecode file that you want to execute.

y y

Command line arguments example Keywords


o o o o o o o o o o o o o o o o o o o o o o o o abstract default if private this boolean do implements protected throw break double import public throws byte else instanceof return transient case extends int short

o o o o o o o o o o o o o o o o o o o o o o o o

try catch final interface static void char finally long strictfp volatile class float native super while const for new switch continue goto package synchronized assert

o y

Special Keywords (literals not keywords) o o o true false null

Identifiers

o o o y

An identifier cannot be a keyword or true, false, or null. An identifier can consist of letters, digits 09, the underscore, or the dollar sign. An identifier must start with a letter, an underscore, or a dollar sign.

Data Type In Java o o [with example] 4 data types are same (number types) differs only in size

Variables o Are used to store data

Constants

Вам также может понравиться