[Java] Overloading (생성자, 메소드 오버로딩)
1. 생성자 오버로딩 클래스 이름이 동일할 것 매개 변수의 타입, 개수, 순서가 달라야 한다 public class Car { //필드 String model; String color; int price; int speed; Car(){//기본생성자 } Car(String model){ this.model = model; // 필드 model = 매개변수 model } Car(String model, String color){ this.model = model; this.color = color; } Car(int price, int speed){ this.price = price; this.speed = speed; } } public class MainClass { public static void ..