Question: 4. There are 2 compiler errors, in the code below; write the line that has an error and specify what the error is ?
4. There are 2 compiler errors, in the code below; write the line that has an error and specify what the error is ? public class A { } public int q; public void setq (int q) this.q-q; } public void findIt(); public String toString() { return "q: "+q; } class B extends A { private int y = 1; public void findIt () { System.out.println(q); } public String toString() { return "y: "+y; } Db new D(); System.out.println (b.toString()); Q5. This will generate an error, because my Numbers [10] does not exist. Which exception should be added to prevent the Error? public class Main { public static void main(String[] args) { } int[] myNumbers {1, 2, 3}; System.out.println(myNumbers [10]); // error! } Answer:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
