SHARE
TWEET

Subtyping Java Error

a guest May 11th, 2010 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Want to get better at Java?
Learn to code Java in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top