运行 ❯
获取您自己的
Java 服务器
×
更改方向
更改主题,深色/浅色
转到 Spaces
Main.java
Second.java
public class Main { public void fullThrottle() { System.out.println("The car is going as fast as it can!"); } public void speed(int maxSpeed) { System.out.println("Max speed is: " + maxSpeed); } }
class Second { public static void main(String[] args) { Main myCar = new Main(); // Create a myCar object myCar.fullThrottle(); // Call the fullThrottle() method myCar.speed(200); // Call the speed() method } }
这辆车正在以最快的速度行驶!
最高速度是:200