Find three run-time errors in the following program. public class HasErrors { public static void main(String[] args)

Question:

Find three run-time errors in the following program.

public class HasErrors
{
public static void main(String[] args)
{
int x = 0;
int y = 0;
Scanner in = new Scanner("System.in");
System.out.print("Please enter an integer:");
x = in.readInt();
System.out.print("Please enter another integer: ");
x = in.readInt();
System.out.println("The sum is " + x + y);
}
}

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: