Home / MCQ Bank / Computer
Computer Overriding And Overloading Difficulty: Medium

What will be the output of the following Java code? class overload { 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 Overload_methods { public static void main(String args[]) { overload obj = new overload(); int a = 2; double b = 3.2; obj.add(a, a); obj.add(b, b); System.out.println(obj.x + " " + obj.y); } }

Select the correct option to test your answer:

More Computer Questions

Which of the following services dynamically resolves NetBIOS-to-IP resolution? List Box and Text box Which function is used to get the total capacity of a vector? Which of the following is not a step in data analysis? Which of the following is first generation of computer?