This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes How can I develop java code for all platforms/OS  ?. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How can I develop java code for all platforms/OS  ?." Watch "How can I develop java code for all platforms/OS  ?." New topic
Author

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

Praveen Kumar
Ranch Hand

Joined: Nov 06, 2006
Posts: 133
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

Joined: Oct 13, 2005
Posts: 37955
    
  22
Avoid OS specific features, eg thread priorities, use of \n and \r, use of \\ or / between files, use of ; or : between paths.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I develop java code for all platforms/OS ?.
 
Similar Threads
JDK, JVM and JRE
Is JDK same for all platforms(windows,unix,mac) or is it different for different operating systems.
JVM doubt
Need info on Java platform independence
basic query