This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I develop java code for all platforms/OS ?.

 
Praveen Kumar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,


In an interview, I faced above question and I answered that JVM is platform dependent and there is separate JVM for each OS. So we need to run the code in respective JVM then we can use same java code in
all OS. I hope i said is correct answer .. Then interviewer asked me that Do we have any rules to follow in java coding ?. Here I am not aware the rules we need to follow.

Please tell me what rules we need to take care when ever your developing java code for all platforms ?.






 
Campbell Ritchie
Sheriff
Posts: 48415
56
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avoid OS specific features, eg thread priorities, use of \n and \r, use of \\ or / between files, use of ; or : between paths.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic