OOP, Class, Object concept & definition (객체지향 개념 정의)

Java is an object-oriented programming language.

자바는 객체지향의 언어이다. 


Everything in Java is associated with classes and objects, along with their attributes and methods. the easiest way to discern the 3 major objects of Class, Constructor, and Method is the way of writing the code. Also, understanding the basic concept of each is the key point. 


----------------------------------------------------------------------------------------

package back;

import front.FrontEnd;
(1) public class BackEnd {
(2) public BackEnd() {
(3) System.out.println("Backend class");
(4) FrontEnd frontEnd = new FrontEnd();
}
}
-----------------------------------------------------------------------------------------

(1) Class is located next to the Public : Public 옆에 위치한 것이 Class 이다.

(2) Once assign Class, need to use Constructor to add class: Class를 한번 정의 하면, Constructor 을 이용해서 Class 를 표현해야 한다.

(2-1) Inside same package, No need to use the formula “NEW” to add constuctor.

: 같은 패키지 안에 Constructor 를 추가 할 땐 New (4번) 공식을 사용할 필요가 없다.

(3) Method : 3번은 method 이다.

(4) When bringing a class by using of constructor need to use the formula “new”: 다른 패키지에서 constructor 를 불러 올 때는, New 공식을 사용해야 한다.


사실상, Constructor 역시 Method 로 분류 되지만, 다른 특정 값을 불러오는 역할로 분리될 뿐이다. 이때 Class 를 도와주고 기여하는 요소가 Method 이다. 



Java type of form:

                        - Object

                        -Class (constructor)

                        - Class = Object = Constructor

Class

                     - Method (Function)

                     -Field (Storage)



Providing a valuable meaning to an object is OOP (Object Oriented Process).


Comments