1 1 Java Java n n Java Java

  • Slides: 57
Download presentation

1. 1 Java 소개

1. 1 Java 소개

Java 소개 내용 n n Java의 플랫폼 독립성 Java 환경 n n n Java

Java 소개 내용 n n Java의 플랫폼 독립성 Java 환경 n n n Java 프로그래밍 환경(programming environment) Java 실행 환경(run-time environment) Java 플랫폼(platforms)

프로그래밍 언어 n 소프트웨어가 발전함에 따라 새로운 프로그래밍 언어 가 소개되었다. n 주요 언어

프로그래밍 언어 n 소프트웨어가 발전함에 따라 새로운 프로그래밍 언어 가 소개되었다. n 주요 언어 n n n Assembly : ~1960, hardware access Fortran : 1960 s ~1980 s, scientific program C : 1970 s~1990 s, all kinds of program C++ : 1980 s~1990 s, OO-based program Java : 1990 s~, ubiquitous program C# : 2000 s~, MS Windows-based program

플랫폼 종속성 x 86 Windows Compiler C program x 86 Windows Executable Windows (x

플랫폼 종속성 x 86 Windows Compiler C program x 86 Windows Executable Windows (x 86) x 86 Linux Executable Linux (x 86) SPARC Solaris Executable Solaris (SPARC) x 86 Linux Compiler SPARC Solaris Compiler

의존성은 어디에서 오는가? n Programs should modify themselves in accord with a specific platform.

의존성은 어디에서 오는가? n Programs should modify themselves in accord with a specific platform. n Hardware n n n Instruction set architecture (ISA) Memory management model Operating System n n n Executable file format API (Application Programming Interface) Linking and relocation : addressing reference

플랫폼 독립성 Windows, JVM (x 86) Java program Java class file Linux, JVM (x

플랫폼 독립성 Windows, JVM (x 86) Java program Java class file Linux, JVM (x 86) Java Compiler Solaris, JVM (SPARC)

Java 프로그래밍 환경 n n A Java program = multiple “. java” files A

Java 프로그래밍 환경 n n A Java program = multiple “. java” files A Java executable = multiple “. class” files App_1. java App_2. java App_1. java Java programming environment App_1. class App_2. class App_1. class

Java Compiler (javac) Program “App” class App 1 { … }; class App 2

Java Compiler (javac) Program “App” class App 1 { … }; class App 2 { … }; class App 3 { … }; n Java compiler App 2. class App 3. class Compiles a Java source into multiple class files n n n App 1. class A Java source consists of definitions of multiple classes. Java compiler creates a class file per a class definition. Currently, n n n Javac does not generate good-quality code. Almost no optimization JRE itself should perform optimization

Java Document Generator(javadoc) n Comments of ‘/**. . */’ n 클래스, 메쏘드, 필드 등에

Java Document Generator(javadoc) n Comments of ‘/**. . */’ n 클래스, 메쏘드, 필드 등에 관한 주석 정보 Java file containing API description javadoc

Java 실행 환경 (JRE) n 바이트코드 프로그램 실행 환경 n n n Java virtual

Java 실행 환경 (JRE) n 바이트코드 프로그램 실행 환경 n n n Java virtual machine(JVM) : 바이트코드 실행 Java API : 표준 클래스 라이브러리 JRE 구성 n n n Java processor + Java. OS + JVM Non-Java processor + OS + JVM

JRE 구성 Applets and Applications Java Standard Extension API Java Base Classes Java Standard

JRE 구성 Applets and Applications Java Standard Extension API Java Base Classes Java Standard Extension Classes Java Virtual Machine Porting Interface Adapter Browser OS Hardware Java on a Browser Adapter OS Hardware Adapter Java. OS OS Hardware Java on a desktop OS Java on a smaller OS Java on Java. OS

Java 프로세서 n Bytecode execution hardware engine n n n Hard to implement all

Java 프로세서 n Bytecode execution hardware engine n n n Hard to implement all JVM functionalities n n pico. Java, micro. Java, ultra. Java Bytecode frontend for ARM Memory management Thread management Require the support of Java. OS or JVM So far, not popular n Language-specific hardware is a bit expensive.

Java. OS n Operating system for Java platform n n n Java virtual machine

Java. OS n Operating system for Java platform n n n Java virtual machine Java Embedded API Windowing, Networking, File system n Designed for Network Computer(NC), consumer device, and network device n So far, not popular n Language-specific OS is a bit expensive.

JRE on Java. OS Applets and Applications Java Standard Extension API Java. OS Java

JRE on Java. OS Applets and Applications Java Standard Extension API Java. OS Java API JVM JVM Java. Chip M processor

Java 종류

Java 종류

J 2 EE n Java 2 Enterprise Edition n n 서버 응용 프로그램을 위한

J 2 EE n Java 2 Enterprise Edition n n 서버 응용 프로그램을 위한 Java 플랫폼 다양한 기술을 통합 n n n Servlet과 JSP(Java Server Page) Enterprise Java. Beans(컴포넌트 기술) CORBA JDBC, XML, Java Transactions Hot. Spot server VM 긴 실행 시간 n n 빠른 실행 동적 컴파일

Java 플랫폼 Embedded Space Java Classes TV Profile Screen Phone Profile Car Profile CDC

Java 플랫폼 Embedded Space Java Classes TV Profile Screen Phone Profile Car Profile CDC Foundation Class Hot. Spot JVM Servers Workstations PCs J 2 EE J 2 SE CVM Thin Clients Kitty. Hawk Doja. P MIDP Profile CLDC Core Class Smart Card Profile KVM Card VM Battery Powered Card J 2 ME (Java 2 Micro Edition)

http: //www. gamelan. com/

http: //www. gamelan. com/

http: //www. javaworld. com/ 온라인 자바 관련 잡지

http: //www. javaworld. com/ 온라인 자바 관련 잡지

http: //developer. java. sun. com/

http: //developer. java. sun. com/

http: //www. gnu. org/software/java/ GNU 자바 사이트

http: //www. gnu. org/software/java/ GNU 자바 사이트

http: //www. javalobby. org/

http: //www. javalobby. org/

Hello. World. java 1. 편집기를 이용해서 Hello. World. java 파일을 작성 1 class Hello.

Hello. World. java 1. 편집기를 이용해서 Hello. World. java 파일을 작성 1 class Hello. World { 2 3 // 주석 부분 4 public static void main (String args[ ]) { 5 6 String msg = "World"; 7 8 System. out. print("Hello "); 9 System. out. println(msg); 10 } 11 }

Hello. World. java 2. javac 이용해서 Hello. World. java 파일을 컴파일 % javac Hello.

Hello. World. java 2. javac 이용해서 Hello. World. java 파일을 컴파일 % javac Hello. World. java 3. 컴파일하면 Hello. World. class라는 파일이 생성됨 4. Hello. World. class 파일을 자바 인터프리터 java에 의해 실행 n 결과 % java Hello. World Hello World

자바 애플릿 Hello. java 1. 편집기를 이용해서 Hello. java 파일을 작성 1 import java.

자바 애플릿 Hello. java 1. 편집기를 이용해서 Hello. java 파일을 작성 1 import java. awt. *; 2 import java. applet. *; 3 4 public class Hello extends Applet { 5 private String Greeting[ ] = "Hello, world "; 6 7 public void paint(Graphics g) { 8 g. draw. String(Greeting[0], 25); 9 } 10 }

자바 애플릿 Hello. java 2. 편집기를 이용해서 Hello. html 파일을 작성 예제: Hello. html

자바 애플릿 Hello. java 2. 편집기를 이용해서 Hello. html 파일을 작성 예제: Hello. html 1 <html><head><title>Hello</title></head> 2 <body> 3 <applet code=Hello. class width=250 height=250> 4 </applet> 5 </body> 6 </html>

자바 애플릿 Hello. java n 결과 % appletviewer Hello. html

자바 애플릿 Hello. java n 결과 % appletviewer Hello. html