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 (](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1606/7/2/2/4345fc4a382b9c331606722347927.jpg)
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
Mistakes in Oops2 program 1 line 4 There should be a between is and x 2 line 4 V... View full answer
Get step-by-step solutions from verified subject matter experts
