File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Java Rules and Exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Java Rules and Exceptions" Watch "Java Rules and Exceptions" New topic

Java Rules and Exceptions

John Held

Joined: Jun 13, 2002
Posts: 13
It seems like one of the difficulties in fully understanding Java is that it is difficult to find an organized list of Java's rules--and then
the exceptions to the rule.
Does anyone know of such an organized list?
Here is an example of what I'm talking about:
Rule: a switch argument can be anything smaller or equal to an int
Exception: if one of the case statements contains a number larger than the type of switch argument, we have a compiler error
byte a = 7;
switch (a) {
case 128:
System.out.println("We have a problem here.");

John Held
Brian Lugo
Ranch Hand

Joined: Nov 10, 2000
Posts: 165
You may want to refer to the Java Language Specification:
I hope this helps,
jQuery in Action, 3rd edition
subject: Java Rules and Exceptions
It's not a secret anymore!