Fullstack-Study-241204-250625

커리큘럼(12-30/변경)

01. Java (v)
02. git 
03. Database
04. Jsp [Server]

05. 미니프로젝트 (3W)
06. HTML,CSS  
07. JS

08. SpringFramework , SrpingBoot
09. React JS [Front-end]
10. 중간프로젝트 (1M)
11. Linux 명령어
12. AWS 클라우드
13. DevOps - Docker
14. App - Android
15. 최종프로젝트 (1M)

클래스 키워드

this

public class Person{

	String name; 
	int age; 

	public Person(String name, int age){
		this.name = name; // this.로 나의 멤버변수 접근 가능
		this.age = age;
	}
	
	public Person(String name){
		this(name,1); // this()로 나의 생성자의 접근 가능
	}

	public Person(){
		this("이름없음",1);
	}

	public String getDetails(){
		return "이름: "+name+"\t나이: "+age;
	}

}

super

public class Airplane{

	void takeOff(){
		System.out.println("비행기가 이륙합니다.");
	}

	void fly(){
		System.out.println("일반 모드로 비행합니다.");
	}

	void land(){
		System.out.println("비행기가 착륙합니다.");
	}
}

public class SuperSonicAp extends Airplane{

	int flyMode = 1;

	void fly(){ // 자식 객체의 생성자
		if(flyMode==1){
			System.out.println("초음속 모드로 비행합니다.");
		}
		else[
			super.fly();  // 부모 객체의 생성자 호출
		]
	}
}

접근제한자(Access Modifier)

종류


OOP기술 - 은닉

정보은닉 - 캡슐화(Encapsulation)

getter

  1. 은닉 변수에 값을 저장하기 위한 메서드
  2. 접근 제어자를 public으로 선언하고 이름 (set+멤버변수명)으로 설정정

setter

  1. 은닉 변수에 값을 조회하기 위한 메서드
  2. 접근제어자 public으로 선언하고 이름 (get+멤버변수명) 으로 설정
public class MyDate{
	private int year;
	private int month
	private int day;

	public void setYear(int year){
		this.year=year;
	}

	public int getYear(){
		return year;
	}

	public void setMonth(int month){
		this.month=month;
	}
	public int getMonth(){
		return month;
	}

	public void setDay(int day){
		this.day=day;
	}
	public int getDay(){
		return day;
	}

}