// Main class作成
public class Main {
// fullThrottle()メソッド作成
public void fullThrottle() {
System.out.println("The car is going as fast as it can!");
}
// speed()メソッドを作成し、パラメーターを追加する
public void speed(int maxSpeed) {
System.out.println("Max speed is: " + maxSpeed);
}
// main内で、myCarオブジェクトのメソッドを呼び出す。
public static void main(String[] args) {
Main myCar = new Main(); //myCarオブジェクト作成
myCar.fullThrottle(); // fullThrottle()メソッドの呼び出し
myCar.speed(200); // speed()メソッドの呼び出し
}
}