Computers/Language java

week1. Introduction

emzei 2011. 4. 9. 14:39

본 포스트의 요약은 제가 현재 학교 수업으로 듣고 있는 객체지향 프로그래밍 및 실습이란 과목입니다.

현 과목에서 저희 수업은 java 언어를 통하여 객체지향 프로그래밍을 배우고 있습니다.

영어로 수업을 배우고 있어서, 모든 요약은 거의 영어로 됩니다.

제 스스로 복습을 위한 정리 공간이지만, 이 글을 읽는 분에게도 도움이 되었으면 합니다.

 

 

◆ Java programming Language

- Simple 

- Safe 

- Paltform-independent("write once, run anywhere")

- Rich library(Package)

- Designed for the internet

 

 

◆ The Structure of a Simple Program

Class Declaration

- Class : fundamental building blocks of Java Program

public class HelloPrinter

- every source can contain at most one public class

- The name if the public class must match the name of the file containing the class

Class HelloPrinter must be contained in a file named HelloPrinter.java

 

main Method

- Every Java application contains a class with a main method

declares a main method

pubilic static void main(String[] args)

{

...

}

 

Comments

- The first line inside the main method is a comment

 

Statements

- The body of the main method contains statements inside the curly bracket({}).

- Each statement end in a semicolon(;).

- Statements are executed one by one

 

Method Call

- System.out.println("Hello, world!"); is a method call

=> System.out ( method is invoked on this object): Object

=> println() (name of method) : Method

=> "Hello,World!"  : Parameters

String

- A sequence of characters enclosed in double quotation marks ("")

 

 

◆ Editing a Java Program

- Java is case-sensitive : distinguish between upper- and lowercase letters

- Lay out your program so that they are easy to read

 

 

◆ Compiling and Running a Java Program

- source code  ---[ Java Compiler ]---> class files contain instruction for the Java virtual machine

- class file has extension .class

 

◆ Errors

 

Compile-time error : A violation of the programming language rules that is detected by the compiler

ex. System.ou.println("Hello,world!"); -> Syntax error

Run-time error : Causes the program to take an action that the programmer did not intend

ex. System.out.println("Hello,world!"); System.out.println(1/0); -> Logic error

 

 

◆ Algorithms

- A sequence of steps that is :  *umambiguougs, *executable, *terminating

 

 

◆ Pseudocode : An informal description of an algorithm

 

 

 

 

10주 넘게 수업나갔는데... 이제요약시작 ;

뭐든지 기본 개념이 제일 중요합니다 :)

'Computers > Language java' 카테고리의 다른 글

week4. Fundamental Data Types  (0) 2011.04.10
week3. Implementing Classes (Basic Java Concept part2)  (0) 2011.04.10
week2. Using Objects (Basic Java Concept part1)  (0) 2011.04.10
eclipse 단축키  (0) 2011.04.08
Java api 원문 링크  (0) 2011.04.07