Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. (6 marks) Identify and explain in your own words three compile-time errors in the following Java code. How would you correct the errors

 

7. (6 marks) Identify and explain in your own words three compile-time errors in the following Java code. How would you correct the errors you have found (with as changes to as few lines as possible)? 1 public class Up20 { 2 3 private int data; 4 1 public class Down20 extends Up20 { 5 public Up20 (String s) { 2 6 data = 20; 3 public Down20 (int data) { 7 } 4 super (null); 8 5 this.data = 40%; 9 void setData(int d) { 6 } 10 data = d; 7 11 } 8 public Down20() { 12 9 } 13 public Object get() { 10 14 return this; 11 15 } 12 public Object get() { return super.get() + "Down20"; 16 13 } 17 public Integer getLength() { 14 18 return s.length(); 15 19 } 16 20 17 @Override public boolean equals (Down20 o) { return this == 0%;B 21 String s; 18 } 22 19}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Accounting A User Perspective

Authors: Robert E Hoskin, Maureen R Fizzell, Donald C Cherry

6th Canadian Edition

470676604, 978-0470676608

More Books

Students also viewed these Programming questions