my dog learned polymorphism*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Assignment code indentation...help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Assignment code indentation...help!" Watch "Assignment code indentation...help!" New topic
Author

Assignment code indentation...help!

Andrea Gazzarini
Ranch Hand

Joined: Sep 09, 2002
Posts: 125
I'm not sure about the coding conventions of my assigment..for example
what is the right indentation between the row where is "throws" and the rows where is the "switch"?



Thanks...


Regards,<br />Andrea<br /> <br /><a href="http://www.linkedin.com/in/andreagazzarini" target="_blank" rel="nofollow">Andrea Gazzarini</a><br />Skype ID : gazzax72<br />Google Talk ID : a.gazzarini@gmail.com<br /><a href="http://www.andreagazzarini.blogspot.com" target="_blank" rel="nofollow">My Blog</a>
Andrea Gazzarini
Ranch Hand

Joined: Sep 09, 2002
Posts: 125
Sorry, but It's the first time I use the UBB Code...the problem about the indentation is only between the "throws" and the "switch" row...the "case" rows are not formatted
Thanks
Adam Till
Ranch Hand

Joined: Oct 11, 2002
Posts: 41
Hi
Have a look at:-
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html
note its recomended to have indentations of 8 spaces and not using tabs.


Adam Till<br />SCJP SCJD SCWCD
Aruna Raghavan
Ranch Hand

Joined: May 14, 2002
Posts: 194
Adam,
I read it as "unit of indentation is 4 spaces and tag eight spaces. The exact nature of indent ( tab vs. spaces) is unspecified'.
I decided to disable tabs and use spaces. so, I am using 4 spaces.
Aruna.


Aruna A. Raghavan<br />SCJP, SCJD, SCWCD
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

I'm not sure about the coding conventions of my assigment..for example
what is the right indentation between the row where is "throws" and the rows where is the "switch"?

Break after a comma.
Break before an operator.
Prefer higher-level breaks to lower-level breaks.
Align the new line with the beginning of the expression at the same level on the previous line.
If the above rules lead to confusing code or to code that's squished up against the right margin, just indent 8 spaces instead.
Therefore, your code becomes this:

Eugene.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Assignment code indentation...help!