Home / MCQ Bank / Computer
Computer Interfaces And Abstract Classes Difficulty: Medium

What will be the output of the following Java code? class A { int x; int y; void display() { System.out.print(x + " " + y); } } class Output { public static void main(String args[]) { A obj1 = new A(); A obj2 = new A(); obj1.x = 1; obj1.y = 2; obj2 = obj1.clone(); obj1.display(); obj2.display(); } }

Select the correct option to test your answer:

More Computer Questions

Which function gives the list as output? Which header file is used for generating random numbers? In PHP, the difference between double quote and single quote is that variables . . . . in single quoted strings whereas they . . . . . in double quoted strings. Which of the following selector selects the elements that are checked? strlen() returns the length of the string on success and . . . . if the string is empty.