• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sun's Java Code Conventions

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In scjp 6 their given Sun's Java Code Conventions. but if v do not use that rules then compile will given an error?
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Code conventions are given for writing understandable code. Following the syntactical rules is what the compiler looks for. If you are asking about Variable naming rules- yes it has to be followed. Also there's Java bean naming conventions which has to be followed.
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Roshni!
 
Ranch Hand
Posts: 300
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi Roshni,

Java code conventions are set of guidelines to follow while writing java code so that everyone involve in Java development can easily understand the code and continue with development . As 90% time of software spent in maintenance writing readable code with set of guidelines helps maintenance in long run.

to learn more about Java coding convention see here http://www.oracle.com/technetwork/java/codeconv-138413.html

Thanks
Javin
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you're thinking about things like formatting and how to use whitespace - none of that is on the exam. As far as the exam is concerned, these two pieces of code are the same:

class Dog { public static void main(String[] a) { int x = 0; }}

and

class Dog {
public static void main(String[] a) {
int x = 0;
}
}

And you will often see code crunched together badly on the real exam. (Like the first example.)

So, the first example does NOT follow standard code "formatting" conventions, but it will compile, and it would be okay code on the real exam.

hth,

Bert
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roshni sharma wrote:... but if v do not ...


V for Vendetta?
V the TV series?
V - Visa Inc?
Chanel V?

Conventions exist for a reason. One of the main reasons is for assisting in communication between people (this includes coding conventions). You might want to look at UseRealWords
 
Roshni sharma
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help. Now i understand it...


thanks again
 
reply
    Bookmark Topic Watch Topic
  • New Topic