일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- MIPS
- DATAPATH
- control
- python
- react
- computer
- MacOS
- DB
- Linux
- instruction
- system
- Class
- XML
- function
- DS
- github
- DoM
- CSS
- while
- Java
- for
- web
- php
- html
- javascript
- Algorithm
- data structure
- architecture
- mysql
- Pipelining
- Today
- Total
목록Class (11)
YYYEJI

추상 메소드(Abstract method)란? 반드시 오버라이딩(overriding)해야 사용할 수 있는 메소드(method)를 의미합니다. 추상 클래스(Abstract Class)란? Abstract로 지정된 클래스(class)는 객체(object) 생성이 불가능한 클래스입니다. 추상 메소드(abstract method)가 하나라도 포함되어 있으면 추상 클래스(abstract class)입니다. 추상 메소드(Abstract method)의 목적 추상 메소드를 상속받는 하위 클래스가 반드시 추상 메소드를 구현하도록 하기 위해서 입니다. 추상 클래스 코드 public abstract class Room_light { abstract void askForTrunOn(); abstract void askFor..

Wrapper class란? Primitive type을 class type으로 포장해 주는 클래스를 말합니다. Primitive type Class type Method to convert back int Integer intValue() long Long longValue() float Float floatValue() double Double doubleValue() char Charactcer charValue() Integer class로 예제를 살펴보겠습니다. public static void main(String[] args) { Integer n = new Integer(10); System.out.println(n.intValue()); } Primitive type의 변수에 값을 할당할..

코드를 살펴보면서 시작하도록 하겠습니다. 아래 코드의 결과가 왜 똑같이 나오는지 하나하나 살펴봅시다! public static void main(String[] args) { p person_info_1 = new p(); p person_info_2 = new p(); person_info_1.set("Jenie", 26); person_info_2.set("Jiso", 27); person_info_2 = person_info_1; person_info_2.set("Rosie", 25); System.out.println(" "); person_info_2.writeOutput(); System.out.println("\n"); person..

Class Diagram이란? UML(Unified Modeling Language)은 모델을 표현해주는 모델링 언어인데 UML을 사용해서 program의 구조를 나타내줍니다. 클래스 내부 구성요소 및 클래스 간의 관계를 도식화하여 시스템의 특정 모듈이나 일부 및 전체를 구조화하게 됩니다. Visibility Java Syntax UML Syntax public public + protected protected # private private - ① public 어디서나 접근이 가능합니다. ② protected 동일한 패키지 내에 존재하거나 파생클래스에서만 접근 가능합니다. ③ private 자기 자신의 클래스 내에서만 접근이 가능합니다. ④ default 아무런 접근 제한자를 명시하지 않으면 defa..

OOP rogramming에서는 모든 데이터를 객체(object)로 생각합니다. Class란? 객체를 정의하는 설계도입니다. class 안에는 아래와 같이 생성됩니다. Instance - 메모리에 할당된 객체이며, 객체가 생성되면 자신만의 필드를 가짐. Instance variable - 객체가 생성될 때 자동으로 생성되는 변수 method - 특정 작업을 수행해 주는 함수 즉 메소드(Method)는 class의 어떤 일을 수행하는 행동(action)입니다. 마지막으로 객체를 생성하기 위해서는 아래와 같이 사용하시면 됩니다. 객체 생성 (Instantiating, Create Object) Class_name object_name = new Constructor() 자바에서 객체를 생성하기 위해 new를..

Enum class 란? 클래스는 아니지만 클래스처럼 보이며, 관련있는 값이 모인 상수입니다. ↓↓↓ Enum 의 특징 ↓↓↓ - index 값을 가짐. - 상수들은 모두 대문자로 지정. - 세미콜론(;)을 찍지 않음. - 상수와 특정 값을 연결시킬 때는 세미콜론(;)을 찍음. Enum은 언제 사용되나요? 한정된 데이터들을 갖는 경우에 사용하면 편리합니다. 요일 같은 경우에 총 7개의 데이터만을 갖기 때문에 Enum으로 데이터를 묶어줄 수 있습니다. Week = { MON, TUE, WED, THU, FRI, SAT, SUN} 기본 예제입니다. package practice; public class EnumTest { enum School {KINDERGARTEN, ELEMENTARYSCHOOL, MID..

Scanner class란? User에게 값을 입력받는 클래스입니다. ↓↓↓ Scanner class의 method를 하나씩 살펴보겠습니다 ↓↓↓ 우선 Scanner class를 사용할 때는 아래 패키지를 import 해야 됩니다. import java.util.Scanner; 패키지를 improt해준 이후에는 object를 생성해줍니다. public static void main(String[] args) { Scanner scan = new Scanner(System.in); } ① next() & nextLine() public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s1 = scan.next()..