2013년 8월 6일 화요일

The "Hello World!" in Eclipse










Lesson: The "Hello World!" Application


( http://docs.oracle.com/javase/tutorial/getStarted/cupojava/index.html )






class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}














D:\Java\Work\pp003>java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

D:\Java\Work\pp003>dir

2013-08-06  오전 11:04    <DIR>          .
2013-08-06  오전 11:04    <DIR>          ..
2013-08-06  오전 11:04               116 HelloWorldApp.java


D:\Java\Work\pp003>javac HelloWorldApp.java

D:\Java\Work\pp003>dir

2013-08-06  오전 11:04    <DIR>          .
2013-08-06  오전 11:04    <DIR>          ..
2013-08-06  오전 11:04               432 HelloWorldApp.class
2013-08-06  오전 11:04               116 HelloWorldApp.java


D:\Java\Work\pp003>java HelloWorldApp
Hello World!







How will Java technology change my life?


( http://docs.oracle.com/javase/tutorial/getStarted/intro/changemylife.html )



Java can't promise me fame, fortune, or even a job.
Still, it is likely to make my programs better and requires less effort than other languages.


They believe that Java technology will help me do the following:


Get started quickly: because it's easy to learn, especially for programmers already familiar with C or C++, just like me.

Write less code: a program written in Java programming language can be four times smaller than the same program written in C++.
( the life of C++ programmer is four times harder than the life of Java programmer. That's why my life was so hard. )

Write better code: because java language encourages good coding practices.
And because its object orientation and component architecture ( JavaBeans ) and easily extendible API let me reuse existing, tested code.


Develop programs more quickly: because java language is simpler than C++, and as such, my development time could be up to twice as fast.


Avoid platform dependencies:

Write once, run anywhere: ( Really? )

Distribute software more easily: With Java Web Start software. It does automatic version check at startup.





What can Java Technology do?


( http://docs.oracle.com/javase/tutorial/getStarted/intro/cando.html )


Java platform gives me the following feature:

Development Tools:
      the javac compiler
      the java launcher
      the javadoc documentation tools

Application Programming Interface (API)


Deployment Technologies:
      Java Web Start software
      Java Plug-in software

User Interface Toolkits:
      Swing
      Java 2D toolkits

Integration Libraries:
      Java IDL API
      JDBC API
      JNDI API
      Java RMI
      Java RMI-IIOP




About the Java Technology


( http://docs.oracle.com/javase/tutorial/getStarted/intro/definition.html )




.java : plain text files
.class : bytecodes ( the machine language of the Java Virtual Machine )







.class files are capable of running on many different operating systems.



The Java platform has two components.

One is the Java Virtual Machine and the other is Java Application Programming Interface (API)


The Java platform can be a bit slower than native code.
But, Java has great portability.

JVM means a Virtual Machine for the Java platform.