SHARE
TWEET

Subtyping Java Error

a guest May 11th, 2010 109 Never
  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. }
RAW Paste Data
Top