Question: correct the errors then find the output: class A { int x; double y; void add(int a, int b) { x = a +

correct the errors then find the output: class A { int x; 

correct the errors then find the output: class A { int x; double y; void add(int a, int b) { x = a + b; } void add(double c, double d) { y = c +d; } overload() { this.x = 0; this.y = 0; } } class Demo { public static void main(String args[]) { A obj = new A(); int a = 2; double b = 3.2; } } obj.add(a, a); obj.add(b, b); System.out.println(obj.x + " + obj.y);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

lets analyze the output objadda a ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!