Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Object o = 1;
- System.out.println((int) o);
- Class <?> t = int.class;
- System.out.println(t.cast(o));
- Exception in thread "main" java.lang.ClassCastException: Cannot cast java.lang.Integer to int
Add Comment
Please, Sign In to add comment