Question: Consider the following program: Mark all of the lines of code that have a compilation error. For each compilation-error line, explain why it is incorrect.
Consider the following program:

- Mark all of the lines of code that have a compilation error.
- For each compilation-error line, explain why it is incorrect.
For each compilation error, just provide the reason that the error occurs. Do not try to solve the problem by attempting to show a “fixed” version of the program.
public class Test { private static int x; private int y; public static void doIt() { } Test.x this.y } = X = 2; this.y = public void tryIt() { 4; 3; = 1; public static void main(String[] args { do It(); try It(); Test t = new Test(); t.do It(); Test.doIt(); this.try It(); } } // end Test class
Step by Step Solution
3.46 Rating (149 Votes )
There are 3 Steps involved in it
The code sample provided is written in Java and there are several lines that will cause compilation ... View full answer
Get step-by-step solutions from verified subject matter experts
