Question: The following program contains 9 mistakes! What are they? public class Oops2 { 2. public static void main (String [] args) { 3 int x;

The following program contains 9 mistakes! What are they?

public class Oops2 { 2. public static void main (String [] args) { 3 int x; 4 System.out.println (

public class Oops2 { 2. public static void main (String [] args) { 3 int x; 4 System.out.println ("x is" x); int x = 15.2; // set x to 15.2 %3D 7 System.out.println ("x is now + x"); 8 9. int y; // set y to 1 more than x 10 y = int x + 1; 11 System.out.println ("x and y are "+ x + and + y); 12 13 }

Step by Step Solution

3.40 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Mistakes in Oops2 program 1 line 4 There should be a between is and x 2 line 4 V... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Building Java Programs A Back to Basics Approach Questions!