You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InterfaceAndObject.java 832B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import javax.swing.*;
  2. import javax.swing.border.*;
  3. import javax.swing.event.*;
  4. import javax.swing.plaf.FontUIResource;
  5. import java.awt.*;
  6. import java.awt.event.*;
  7. import java.beans.*;
  8. import java.io.*;
  9. import java.util.EventObject;
  10. import java.util.Vector;
  11. public class InterfaceAndObject {
  12. Timer t = null;
  13. public static void main(String[] args) {
  14. I i = new I() {};
  15. System.out.println(i);
  16. //new I() {}.toString();
  17. }
  18. }
  19. class Root {
  20. public String toString() { return "root"; }
  21. }
  22. class C extends Root implements I {}
  23. class C1 extends Root implements I1 {
  24. public Object clone() { return null; }
  25. }
  26. interface I0 {
  27. public Object clone();
  28. }
  29. interface I {
  30. //public void toString();
  31. public boolean equals(Object o);
  32. }
  33. interface I1 extends I, I0 {
  34. //public Object clone();
  35. }