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; 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
lets analyze the output objadda a ... View full answer
Get step-by-step solutions from verified subject matter experts
