[JAVA] Class
·
JAVA
자바(JAVA)에서 클래스(Class)는 객체 지향 프로그래밍(OOP)의 기본 구성 요소이다. 클래스는 객체(Object)의 설계도로서 사용되며, 객체는 데이터와 해당 데이터를 다루는 메서드(Method)로 이루어진 하나의 단위이다. 클래스는 멤버 변수(데이터)와 메서드(동작)로 구성된다. // 클래스 정의 public class Car { // 멤버 변수(상태) private String brand; private String model; private int year; // 생성자(Constructor) public Car(String brand, String model, int year) { this.brand = brand; this.model = model; this.year = year; } ..