permaculture playing cards
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
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,
I agree. Here's the link:
subject: Java Rules and Exceptions
jQuery in Action, 3rd edition