class
-
[JS] ClassProgramming Language/JavaScript 2021. 8. 25. 20:31
Class Javascript는 OOP(object-oriented programming) language입니다. 따라서, 실제 세계를 모델로 class와 instance를 만들어 object들을 사용할 수 있습니다. Syntax example class Dog { constructor(name) { this._name = name; this._behavior = 0; } get name() { return this._name; } get behavior() { return this._behavior; } incrementBehavior() { this._behavior ++; } } const halley = new Dog('Halley'); console.log(halley.name); // Prin..
-
[Python Programming 기초] # Class(클래스)와 Object(객체) : 개념Programming Language/Python 2020. 11. 18. 00:35
# Class(클래스)와 Object(객체) 1. 개념 ex) - Class란? : 새로운 타입을 정의 · 실세계의 것을 모델링하여 속성(attribute)와 동작(method)를 갖는 데이터 타입 · Python에서의 string, int, list, dict... 모두가 다 클래스로 존재 - Object란? · 클래스로 생성되어 구체화된 객체 (=인스턴스) · Python의 모든 것 (int, str, list...)은 객체 (=인스턴스) · Class가 인스턴스화 되어 메모리에 상주하는 상태 본 포스팅은 Fast Campus 머신러닝과 데이터 분석 A-Z 강의를 듣고 정리한 내용을 담고 있습니다.