Está en la página 1de 9

TRUNG TM TIN HC

I HC KHOA HC T NHIN-TP.HCM

NHP MN LP TRNH JAVA

TRUNG TM TIN HC
I HC KHOA HC T NHIN-TP.HCM

Bi 1: Gii thiu lp trnh Java


1. Lch s JDK 2. Ci t JDK v IDE

Bi 1: Gii thiu lp trnh Java

Lch s Java
Java c vit bi James Gosling vo 6/1991 trong d n top box project Ban u gi l Oak c i tn thnh Java 1.0 nm 1995 Khu hiu "Write Once, Run Anywhere" (WORA) Phin bn mi nht J2SE.7 (Dolphin)

James A. Gosling

Bi 1: Gii thiu lp trnh Java

Phn loi
J2SE (Java 2 Standard Edition)
ng dng Desktop

J2EE (Java 2 Enterprise Edition)


ng dng Enterprise

J2ME (Java 2 Mobile Edition)


ng dng Mobile

Bi 1: Gii thiu lp trnh Java

Ci t Java 5
Ti java 5 t www.java.sun.com Thit lp JAVA_HOME

Bi 1: Gii thiu lp trnh Java

Ci t IDE
Netbeans version 6.0
Ti t: www.netbeans.org

JBuilder JCreator JEdit Notepad

Bi 1: Gii thiu lp trnh Java

Thit lp CLASSPATH

Bi 1: Gii thiu lp trnh Java

HelloWorld Application
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 // HelloWorld.java // Printing multiple lines in a dialog box // Java extension packages import javax.swing.JOptionPane; // import class JOptionPane public class HelloWorld { // main method begins execution of Java application public static void main( String args[] ) { JOptionPane.showMessageDialog( null, "Welcome\nto\nJava\nProgramming!" ); System.exit( 0 ); // terminate application } // end method main } // end class HelloWorld
8

Bi 1: Gii thiu lp trnh Java

HelloWorld 1 Application
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // HelloWorld_1.java // Printing multiple lines in console public class HelloWorld _1{ // main method begins execution of Java application public static void main( String args[] ) { System.out.println(Welcome\nto\nJava\nProgramming!);

} // end method main } // end class HelloWorld_1