Last active
August 29, 2015 14:13
-
-
Save capeterson/9e88b1f710fdb88dd44f 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
public class OhGodBees extends Exception{} | |
//fails: OhGodBees: Classes extending Exception must have a name ending in 'Exception' |
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
public class BeesException extends Exception{ | |
public BeesException(){} | |
} | |
//fails: System exception constructor already defined: <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
public class BeesException extends Exception{ | |
public BeesException(String message, Boolean noop){ | |
this.setMessage(message); | |
} | |
public void setMessage(String message){ | |
super.setMessage(message); | |
} | |
} | |
//fails: BeesException: Method must use the override keyword: void setMessage(String) |
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
public class BeesException extends Exception{ | |
public BeesException(String message, Boolean noop){ | |
this.setMessage(message); | |
} | |
public override void setMessage(String message){ | |
super.setMessage(message); | |
} | |
} | |
//fails: Object has no superclass for super invocation |
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
public class BeesException extends Exception{ | |
public BeesException(String message){ | |
this.setMessage(message); | |
} | |
} | |
//fails: System exception constructor already defined: <Constructor>(String) |
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
public virtual class AnException extends Exception{} | |
public class BeesException extends AnException{ | |
public BeesException(String message, Boolean noop){ | |
this.setMessage(message); | |
} | |
public override void setMessage(String message){ | |
super.setMessage(message); | |
} | |
} | |
//works, but not how you'd think |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment