@ Lesson 1,.....
@ 1 Green Project 1991 Oak Java 1995. 5 December '90 by Patrick Naughton, Mike Sheridan and James Gosling Embedded in various consumer electronic device 1992. 9. 3 Star 7 1993 www portability cross platform- independent 1994 java James Gosling, Arthur Van Hoff, Andy Bechtolsheim Hot java, java applet
@ 2 1996 Java 1.0 1999 Java 2 1.2 2000 Java 2 1.3 2001 J2SE 1.3, J2ME1.3, J2EE1.3 2002, 2003 J2SE 1.4, J2ME1.4, J2EE1.4 2004, 2005 JDK5.0 ( 1.5), J2ME, J2EE
@ C++ C Architectural-neutral, Portable:.. Dynamic(Lazy loading):, Distributed :. Interpreted : Byte code. Java C# Multithread : OO:. Robust:. Simple :.
@ 1 path %JAVA_HOME%\bin javac java javadoc appletviewer Java API classpath.; Java core API API rt.jar tools.jar extension: servlet.jar,
@ 2 JAVA_HOME PATH CLASSPATH.; C:\ %JAVA_HOME%\bin; %JAVA_HOME%\lib\tools.jar %JAVA_HOME%\jre\\lib\rt.jar %JAVA_HOME%\jre\lib\ext
@ (, ) javac java javap
@ 1 Virtual Not Real Machine Source Byte Code Byte Code JVM HW/OS Native code HW/OS
@ Legacy vs. Java Legacy Source 1 Source 2 Source 3 HW/WINDOWS HW/LINUX HW/UNIX Java Byte Code JVM JVM JVM HW/WINDOWS HW/LINUX HW/UNIX
@ Compile Runtime Compile 1 Hello.java 2 javac Class Loader Byte code Verifier java Hello.class Class Loader java Byte code Verifier interpreter Runtime Loading interpreter Runtime Jit code generator Hardware Hardware
@ HotSpot & JIT Just-in-time (JIT) compilers promise to improve the performance of Java applications. Rather than letting the JVM run bytecode, a JIT compiler translates code into the host machine's native language. Thus, applications gain the performance enhancement of compiled code while maintaining Java's portability. 3
@ Java2 Platform 1(Edition) Midlet Application Applet JSP Servlet EJB
@ Java2 Platform 2 java.sun.com/products/hotspot JDK JRE JVM
@ Keywords ( ) Keywords abstract float protected boolean for public break future rest byte generic return byvalue goto short case if static cast implements super catch import switch char inner synchronized class instanceof this const int throw continue interface throws default long transient do native true double new try else null var extends operator void false outer volatile final package while finally private assert Grayed words are reserved but not currently in use.
@ Identifiers, - Pascal ex) PersonInSchool, - Camel ex) moneyinmypocket, goschool() (,keyword ) $, _ ($ nested class, _ c ).(2,s2) $, _.
@ Type Type Java Primitive Object Wraper Wraper class Primitive Object Built-in Simple Type Built-in Floating-point Type Built-in Object Type User-defined Object Type Boolean type
@ premitive 1 bit 1 bit 1 bit 1 bit 1 bit 1 bit 1 bit 1 bit byte char short int long long float double
@ vs. logic data method variable message field Flow (, )
@ OOP 3 OOP (Object Oriented Programming) Encapsulation ( ) : Inheritance ( ) : Data (field) member Polymorphism ( ) : reference argument method
@ downloading - http://java.sun.com/j2se/downloads.html installing Configuration (path, classpath) tool editor MS editor BLUEJ (http://www.bluej.org)
@ Popular Java Development Tools JBuilder - Borland VisualCafe - Symantec VisualAge - IBM VisualJ++ - Microsoft Java Development Kit(JDK) - Sun AcroEdit http://www.acroedit.pe.kr/
@ Let s try - Running Java Application // HelloWord.java /* HelloWorld */ class HelloWorld{ // main : public static void main(string args[ ]) { /** Hello World! */ System.out.println("Hello World!"); } } Step 1. Compiling > javac HelloWorld.java Step 2. Run [Byte code] > java HelloWorld
@ Let s try Step 1. Compiling > javac InOutPractice.java Step 2. Run [Byte code] > java InOutPractice
@ Let s try Command Line Argument Step 1. Compiling > javac CommandLine.java Step 2. Run [Byte code] > java CommandLine arg1 arg2 arg3 arg4