import java.util.Scanner;
public class Car{
int speedlimit;
String color;
public void toString(){
System.out.println("my car color is : " + color + " and speed limit is : " + speedlimit );
}
public void int setSpeedLimit(int speedlimit){
this.speedlimit = speedlimit;
}
public void getSpeedLimit(){
return speed;
}
public void string setColor(String color){
this.color = color;
}
public void getColor(){
return color;
}
public static void main(String[] args){
Scanner input = new Scanner(System.in);
String color;
int speedlimit;
color = input.nextString();
speedlimit = input.nextInt();
setSpeedLimit(speedlimit);
getSpeedLimit();
setColor(color);
getColor();
toString();
}
}
'Study > Java Programming' 카테고리의 다른 글
Java Usage ArrayList Example #1 (0) | 2019.04.28 |
---|---|
Java programming practice; Tax (0) | 2018.10.06 |
[Java Programming] Java return, 자바 리턴값 배우기 (0) | 2018.09.09 |
[Java Programming] Java Method 자바 메소드 배우기 (0) | 2018.09.09 |
[Java Programming] Class와 Object 배우기, 클래스 오브젝트 (0) | 2018.09.09 |