A Java program contains variables named "name", "age", and "height", and prints out a series of statements using these variables. The statements introduce a person named John, who is 22 years old and 5.9 feet tall. Can you rearrange the lines of the code in the right order so the program will run successfully?
Printing data
Sorting the details of John's introduction
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
System.out.println("My height is " + height + " feet");
}
}
System.out.println("I am " + age + " years old");
double height = 5.9;
String name = "John";
public class Main {
System.out.println("Hello, my name is " + name);
public static void main(String[] args) {
int age = 22;
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.