What is wrong with the following program public class ShowEr

What is wrong with the following program? public class ShowErrors {public static void main(String[] args) {ShowErrors t = now ShowErrors(S):}} public class ShowErrors {public void method1 () {Circle c: System.out.println(\"What is radius \" + c.getRadius()); c = new Circle():}} public class ShowErrors {public static void main(String[] args) {ShowErrors t = new ShowErrors(): t.x();}} public class ShowErrors {public static void main(String[] args) {C c = new C(5, 0); System.out .print ln(c. value):}} class C {int value =2;}

Solution

(a) :-

Answer : -

There\'s no constructor to accept the integer argument.

Answer : -

Method ShowErrors.x() doesn\'t exist.

Answer : -

c is a null pointer until initialized. Calling any instance method or instance attribute before initializing the object will fail.

Answer : -

No constructor to handle the floating value provided.

 What is wrong with the following program? public class ShowErrors {public static void main(String[] args) {ShowErrors t = now ShowErrors(S):}} public class Sho

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site