See page 5 and 6 of the Java code conventions. Subsequent indentation levels should indent 4 spaces from the previous indentation level, or 8 if that makes the code clearer.
JTW-- (Sorry Jeroen, you are back to your default value).
Section 4.2: Wrapping Lines of the Code Conventions gives two examples of indenting method declarations. Note that they indicate that the first example is the convential case. They also indicate that where the "rules lead to confusing code or to code that's squished up against the right margin, just indent 8 spaces instead."
hmm thanks actually eclipse indents it that way so got confused.
Jeroen T Wenting
Ranch Hand
Joined: Apr 21, 2006
Posts: 1847
posted
0
Check out Eclipse's settings. It can be changed to reflect different coding guidelines set as several defaults. It is quite possible that IBM likes this style, Sun likes another. And for the assignment you'd better do things the way Sun likes them, even if you prefer to do things differently yourself.
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
posted
0
I still think JTW's is prettier Andrew, so JTW += JTW++ + JTW++ (to remind you guys of the good old SCJP days)
Sam Codean
Ranch Hand
Joined: Feb 26, 2006
Posts: 194
posted
0
I still would prefer Andrew's Style as that makes it look more "as per Java Standards"
Jeroen T Wenting
Ranch Hand
Joined: Apr 21, 2006
Posts: 1847
posted
0
I admit that my style is more useful when there are so many exceptions that they no longer fit on a single line than in this scenario. I also admit I don't follow it religiously, but then I'm called a heretic by most religions
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Indentation for Throws clause of a method