Question: java coding 5. Consider the following Java code. Exactly 3 of the numbered lines have syntax errors. Identify the 3 different errors by giving the
java coding5. Consider the following Java code. Exactly 3 of the numbered lines have syntax errors. Identify the 3 different errors by giving the numbers of the incorrect lines. For each error also give a corrected version of the line. Any line without a number is correct as written and is not to be changed. Make sure that your corrections lead to the indicated output. (You can give the 3 answers in any order.) package problems: public class Errors int x,y: static int 23 public Errors() { * - 1: 7/ line 1 Y - 27 77 line 2 2- 3: V line 3 1 public static void tix(Errors - V line 4 public int fix(Errors e, Errors ) X-0. // line 5 y - f.y: W/ line 6 return 0.21 // line 7 1 public static void main(String args)) System.out.println(); // line 8 // The output from the last line should be o Errors - new Errors() 1/ line 9 - fixe // line 10 fixe, ) V/ line 11 System.out.println(); // line 12 1/ The output from the last line should be 3 Anawer C a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
