Created
October 19, 2011 23:56
-
-
Save nathanmarz/1300034 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JavaObjectThatReturnsInt { | |
int getValue(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let [amap {1 (.getValue obj)}] | |
(JavaObjectThatExpectsInt. amap)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JavaObjectThatExpectsInt { | |
public JavaObjectThatExpectsInt(Map<Integer, Integer> vals) { | |
for(Integer key: vals.keySet()) { | |
int val = vals.get(key); // classcast exception! | |
// ... | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment