Created
November 29, 2010 06:30
-
-
Save dai0304/719658 to your computer and use it in GitHub Desktop.
check constructor argument 'n' before invoke super constructor
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 Bar extends Foo { | |
Bar(Number n) { | |
if (n == null) { | |
throw new IllegalArgumentException(); | |
} | |
super(n.toString()); | |
} | |
} |
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 Foo { | |
Foo(String arg) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment