This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Subtyping Java Error

By: a guest on May 11th, 2010  |  syntax: Java  |  size: 0.33 KB  |  views: 107  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public class Subtyping {
  2.     Object someObject = new Object();
  3.     Integer someInteger = new Integer(10);
  4.     someObject = someInteger;
  5.  
  6.     public void getType(Object object) {
  7.         System.out.println(object.getClass().getName());
  8.     }
  9.     public static void main(String[] args) {
  10.         getType(someObject);
  11.     }
  12. }
clone this paste RAW Paste Data