After compilation of java program we'll get .class code. If
it's generated in OS Windows XP will it work on OS Linux? If
yes why? If no why?
Answers were Sorted based on User's Feedback
Answer / rajmallela
Java is platform independent. but JVM is not platform independent .it is platform dependent.Each O.S has its own JVM
That JVM can understand .class file irrespective of the O.S from which it(.class file) is coming . So widows generated .class file will work in Linux O.S.(b/z Linux JVM can understand .class file obviously)
| Is This Answer Correct ? | 22 Yes | 1 No |
Answer / seshadri pera
Ranjmella is obsolutely correct for this Question. JVM is
platform dependent but any JVM specific to that OS will run
the compiled .class file on any OS.
.class files are in bytecode it can be run on any platform
which has it's specific JVM installed in that.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / chandu
It will work, becouse java is platform independent.
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / stranger_ajnabi53@yahoo.c
ya it will work.bcoz java is platform independent.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / anjan singh
Whenever you compile a java code, a bytecode is generated
(i.e. class file). This bytecode can be interpreted by JVM.
So any machine with any platform(i.e.OS) that has JVM on it
can interprete this bytecode or class file.
| Is This Answer Correct ? | 0 Yes | 0 No |
Can java list contain duplicates?
1) There are 10 different threads in runnable state. Each having priority 1 to 10. How does the CPU schedules or executes these threads?
Describe 2 different ways to concatenate two strings.
What is the purpose of the main method?
Define package in Java.
What is the format specifier?
Explain serialization and deserialization in java?
what is the use of Clonable,and serializable interface?
Describe what a thread-local variable is in java?
How do you convert an int to a string in java?
Write a function to find out longest palindrome in a given string?
can we create a instance for intwerface?