The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Java Style Guide Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Java Style Guide" Watch "Java Style Guide" New topic

Java Style Guide

Stef Widmer

Joined: Jun 16, 2004
Posts: 17
Hi all
Since now I've used the array declaration form of:
Also in most Java books I've seen the follwing signature for the main methode :
But now I found the follwing in Suns Java Coding Style Guide from Achut Reddy:

What notation are you using? Is this realy an issue?
Thanks for all response.

[ July 13, 2004: Message edited by: Stef Widmer ]

[ July 13, 2004: Message edited by: Stef Widmer ]
[ July 13, 2004: Message edited by: Stef Widmer ]
Jan Rotthaus
Ranch Hand

Joined: Jun 23, 2004
Posts: 56
Hi Stef,

In Sun's Code Conventions for the Java Programming Language I don't find anything on the declaration of arrays. In my opinion you should always have a Style Guide and for the certification assignment I would adhere to Sun's Style Guide. As far as your declaration question is concerned: The most important thing is, that your array declarations are consistent (I personally prefer to ).

Just my $0.02,


SCJP 1.4, SCJD, SCBCD 1.3, SCMAD 1.0
OCUP Fundamental
Weerawit Maneepongsawat
Ranch Hand

Joined: Apr 11, 2002
Posts: 203

See in example...

hope that help.
[ July 13, 2004: Message edited by: Weerawit Maneepongsawat ]

Weerawit<br />SCJP 1.4, SCWCD 1.2, SCWCD 1.4, SCBCD 1.3, SCBCD 5.0, SCMAD 1.0, SCJA 1.0, SCDJWS, SCJD, SCEA, SCDJWS 1.5
Jon Entwistle
Ranch Hand

Joined: Feb 20, 2003
Posts: 118

I understood the convention to be placing the brackets after the type for readability issues - e.g. int myMethod()[] is a lot more difficult to read than int[] myMethod.

As far as I know, allowing the brackets after the variable is really a concession for those migrating from C.



Stef Widmer

Joined: Jun 16, 2004
Posts: 17
the PDF I've found comes from SUN's site, here's the URL: Java Coding Style Guide
. You'll find the array declaration in section "8.1.3 Array declarations".
Perhabs it's an out dated version. But why'is it than still on Sun's site?
However, it's maybe not worth spending to much time on this issue...

[ July 13, 2004: Message edited by: Stef Widmer ]
I agree. Here's the link: http://aspose.com/file-tools
subject: Java Style Guide
Similar Threads
Displaying things...need help badly!! Please!
Question about the methode defined in the interface
[Bodgit Scrapper] what's the meaning of magic cookie value?
Updating clients when record has been modified?
JavaDoc Question