Question: I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. 

Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal of confusion on this point. 

Secondly, what is the guideline for creating custom exception classes? I typically end up throwing an existing exception rather than creating my own. Is custom exception creation typically enforced?

Answer: 
1. <http://www.oracle.com/technetwork/java/codeconv-138413.html>
2. Wrap to 80 - 110 chars
3. It is great to throw existing. You should only create custom, when
existing exception doesn't quite
match the exceptional case (
usually a business rule )

As a brief for the coding conventions:

```
class SomeClassName { //<-- Class with upper case, camel case
   public static final int CONSTANT_SOMETIHNG = 0x2A; // constants all upper case
   private int secretVariable; // variables start with lowercase
   public void someMethod() {  // methods too 

       // opening brace goes in the same line 

       if( cond ) { 
           ...
       } else { 
           ...
       }
       for( .. ) {
       }
       while( ... ) { 
       }
       try { 
       } catch() { 
       } finally {
       }
       // closing brace aligned to the element start 

    }
  }
}

```

Etc. etc.
1. Line lengths used to be much more of an issue when people used 80 character wide text editors. Today most developers have large high resolution wide screens so wrapping at 80 characters in Java might actually be a disservice if it forces others to scroll down more and have whitespace on the right. Take note of who might be looking at the code you write and wrap it at an appropriate length.
2. My view for Custom Exception classes is to use whatever already exists as far as it makes sense. However, there are times that you need an exception class that does not exist, so if it makes sense don't hesitate to create one.