Run ❯
Get your
own Java
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
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 } }
The car is going as fast as it can!
Max speed is: 200