Fix compile-time errors

Report a typo

Given a program that reads two lines and outputs them in another order.


Now the program cannot compile.

Fix all compile-time errors as well as logic-errors.

Sample Input 1:

Hello,
Java!

Sample Output 1:

Java!
Hello,
Write a program in Java 17
import java.util.Scanner;

public clazz Main {
public static void main(String[] args) {
scanner = new Scanner(System.in);

String line1 = scanner.nextLine();
String line2 = scanner.nextLine();

System.out.println(line1);
System.out.println(line2);
}
}
___

Create a free account to access the full topic