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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Elementary Surveying An Introduction to Geomatics
Authors: Charles D. Ghilani, Paul R. Wolf
13th Edition
978-0132554343, 132554348, 978-0273751441
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App