127k views
4 votes
Write the simplest statement that prints the following on a single line: 3 2 1 Go! Note: Whitespace (blank spaces / blank lines) matters; make sure your whitespace exactly matches the expected output.

User BlueVoodoo
by
4.7k points

1 Answer

0 votes

Answer:

//here is the statement in java.

import java.util.*;

//class definition

class Solution

{

// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

try{

// this statement will print the 3 2 1 Go! and go to newline

System.out.println("3 2 1 Go!");

}catch(Exception ex){

return;}

}

}

Step-by-step explanation:

We can use "System.out.println()" to print the required output same as it required. After printing this, it will go to newline.

Output:

3 2 1 Go!

User Gfyans
by
5.0k points