static

클래스(Class) 1. 클래스(Class) 이번엔 클래스(Class)에 대해 배워보겠습니다. 클래스란? 데이터와 해당 데이터를 처리하는 메서드(함수)의 모음입니다. TypeScript는 클래스를 선언할 때, 다음 예제와 같이 선언합니다. class Car { color: string; constructor(color: string) { this.color = color; } start() { console.log("start"); } } const bmw = new Car("red"); 2. 접근 제한자(Access Modifier) TypeScript에서는 접근 제한자를 지정해 줄 수 있습니다. 이를 통해 정보 은닉 및 캡슐화를 지원할 수 있습니다. TypeScript에서는 세 가지 주요 접근 제한자..
NewBean
'static' 태그의 글 목록