Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
Cloneable
:
Content language: English
Русский
What will be printed as a result of compiling and running the following code? public class Test { public static void main(String[] args) throws Exception { A a = new A(); a.setI(4); if (a instanceof Cloneable) { A a2 = (A) a.clone(); System.out.println(a.getI() == a2.getI()); } } } class A implements Cloneable { private int i; public void setI(int i) { this.i = i; } public int getI() { return i; } }
Cloneable
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes