블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
  • total
  • today
  • yesterday

Category

'object'에 해당되는 글 3건

  1. 2008.05.17 변수
  2. 2008.04.14 Class와 Object
  3. 2007.03.16 <HeadFirst Java> 클래스와 객체
2008. 5. 17. 16:33 @GSMC/정문열: Generative Art
Head First Java 개정판


84쪽
변수는 원시 변수(primitive variable)와 객체 레퍼런스(objectreference)로 나눌 수 있다.

여덟 가지 원시 유형 -
boolean, char, byte, short, int, long, float, double

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html


88쪽
원시 변수는 변수의 실제 값을 나타내는 비트가 들어있지만,
객체 레퍼런스에는 객체에 접근하는 방법을 알려주는 비트가 들어있다. (비트 수는 중요하지 않다.)
(객체 자체는 변수에 저장되지 않는다.)
(96쪽) 레퍼런스 변수의 값은 힙에 들어있는 객체를 건드릴 수 있는 방법을 나타내는 비트.
레퍼런스 변수가 아무 객체도 참조하지 않으면 그 값은 null이 됩니다.

89쪽
객체 선언/생성/대입의 3단계
1. 레퍼런스 변수 선언 (객체를 제어하기 위한 레퍼런스 변수용 공간을 할당)
2. 객체 생성 (힙에 새로운 객체를 위한 공간을 마련)
3. 객체와 레퍼런스 연결 (새로운 객체를 레퍼런스 변수에 대입)

92쪽
garbage collection
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html

http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)


93쪽
배열은 원시 변수의 배열이든 객체 레퍼런스에 대한 배열이든 상관없이 항상 객체입니다.

1. 배열 변수를 선언한다.
2. 일정 길이의 배열을 만들어서 앞서 선언한 변수에 대입한다.
3. 새로운 객체를 생성하고 그 객체를 배열 원소에 대입한다.



'@GSMC > 정문열: Generative Art' 카테고리의 다른 글

genetic programming  (0) 2008.06.05
treemaps  (0) 2008.05.29
class 5/1  (0) 2008.05.01
Class와 Object  (0) 2008.04.14
[이선애] study 1  (0) 2008.03.28
posted by maetel
2008. 4. 14. 15:47 @GSMC/정문열: Generative Art
Head First Java 개정판
68쪽

인스턴스 변수 - 객체에서 자신에 대해 아는 것 (상태)
메소드 - 객체에서 자신이 하는 것 (행동)

인스턴스 변수 - 객체의 상태 - 데이터

"인스턴스(instance)란 객체(object)를 부르는 다른 이름이라고 생각하세요."

정 교수님:
C에서의 new와 Java에서의 new는 다르다.
C에서의 new는 memory를 allocate하는 데 반해,
Java에서의 new는 class의 constructor를 선언하는 것이다.

75쪽
자바 애플리케이션에서는 여러 클래스 가운데 한 클래스에 main 메소드가 있어야 한다. 그리고 그 클래스를 통해서 프로그램을 시작하게 된다.

클래스는 해당 클래스 유형의 객체를 만드는 방법을 설명하는 역할을 한다.



http://java.sun.com/javase/6/docs/api/java/lang/reflect/Array.html

http://java.sun.com/javase/6/docs/api/java/lang/Integer.html
noah:
Java에는 두 가지 종류의 int가 있다. 하나는 C에서와 같은 primitive 유형이고 다른 하나는 java.lang.Number를 상속하는 클래스 유형의 int이다.


'@GSMC > 정문열: Generative Art' 카테고리의 다른 글

변수  (0) 2008.05.17
class 5/1  (0) 2008.05.01
[이선애] study 1  (0) 2008.03.28
class 3/27  (0) 2008.03.27
tree (data structure)  (0) 2008.03.24
posted by maetel
2007. 3. 16. 10:16 Computation/Language
61p
객체 마을로의 여행

constructor(생성자), method(함수), property(변수, 객체)
    cf. instance

절차 지향/객체 지향

 
 procedure
"프로그램이라는 것은 결국은 프로시저를 모아놓은 것"
= Subroutine or method (computer science)
(1) Same as routine, subroutine, and function. A procedure is a section of a program that performs a specific task.
(2) An ordered set of tasks for performing some action.
   
     subroutine http://en.wikipedia.org/wiki/Subroutine
    a portion of code within a larger program, which performs a specific task and is relatively independent of the remaining code.   

 object
Generally, any item that can be individually selected and manipulated. This can include shapes and pictures that appear on a display screen as well as less tangible software entities. In object-oriented programming, for example, an object is a self-contained entity that consists of both data and procedures to manipulate the data.
http://en.wikipedia.org/wiki/Object_%28computer_science%29
http://java.sun.com/docs/books/tutorial/java/concepts/object.html

 method
 In object-oriented programming, a procedure that is executed when an object receives a message. A method is really the same as a procedure, function , or routine in procedural programming languages. The only difference is that in object-oriented programming, a method is always associated with a class.

 instance
(1) 일반적으로 어떤 집합에 대해서, 그 집합의 개별적인 요소. 객체 지향 프로그래밍(OOP)에서, 어떤 등급에 속하는 각 객체를 인스턴스라고 한다. 예를 들면 ‘목록(list)’이라는 등급을 정의하고 그 다음에 ‘본인 목록(my list)’이라는 객체를 생성(기억 장치 할당)하면 그 등급의 인스턴스가 생성된다. 또한 변수가 포함되어 있는 어떤 논리식의 변수에 구체적인 값을 대입하여 식을 만들면 원래 식의 인스턴스가 만들어진다. 이런 의미에서 인스턴스를 실현치라고 한다.
(2) 프로그램 작성 언어 에이다(Ada)에서 매개 변수를 사용해서 절차를 일반적으로 정의한 범용체(generic package)에 대해, 그것으로부터 도출한 구체적인 실체.

 constructor 생성자 生成子
객체 지향 프로그래밍(OOP:objective-oriented programming)에서 쓰이는 객체 초기화 함수. 객체의 생성 시에만 호출되어 메모리 생성과 동시에 객체의 데이터를 초기화하는 역할을 한다.
: 객체를 처음 생성할 때 자동으로 만들어지는 함수.
<=
class의 속성을 정의해 주는 것이 constructor(생성자)이다.



'Computation > Language' 카테고리의 다른 글

features of object-oriented programming  (0) 2007.06.20
내 컴퓨터에서 Processing의 source code 보기  (0) 2007.04.19
Java tutorials  (0) 2007.02.28
The Java™ Tutorials  (0) 2007.02.28
The Java Technology  (0) 2007.02.28
posted by maetel