What is JAVA? Why it is platform independent?
Answer Posted / makin guru ji...
When Java Code is compiled a byte code is generated which
is independent of the system. This byte code is fed to the
JVM (Java Virtual Machine) which is resided in the system.
Since every system has its own JVM, it doesn't matter where
you compile the source code. The byte code generated by the
compiler can be interpreted by any JVM of any machine.
Hence it is called Platform independent Language.
Java is fully object oriented programming language.In java,
source code is compiled to give bytecode(class file).
that class file is able to run in any OS.it is simply
called as "COMPILED ONCE RUN ANYWHERE".class file is fed
into JVM, it will convert the class file into corresponding
machine code.
"what is platform
in dependent?" every os and every machine has its own code
which is known as "MACHINE CODE". I think you know about
asamblly language that is MACHINE CODE. so when we execute
java file it's class file(byte code) convert into this
machine code & then give output.jvm is a program which
needed to convert byte code file into machine code. & every
programing language need it's own compile and runtime
environment. so we always install aproprite tool for each
language.
platform independance means if u compile any progaram one
machine which run on particular os & then u take this
compiled progaram to any other machine which have not same
os still it runs and gives output.
thus we need every language's compiler to run the program.
even if you want to make resume you have to install atlist
ms word.
Java is one of the Object Oriented Language.
Mainly to run on Different Platform and Supporting in
Multi-Threading concept.
Because its only need and run Bytecode on Your platform.
Automatically reclaim Garbage Collection.
Its mainly Memory management.
java is platform independent because when after compile the
java source code it generate the byte code for jvm. it is
execute the byte code instruction for the particular
operating system. this byte code instruction execute the any
operating system it produce the same result thats why java
is platform independent
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
How does hashset works in java?
What carriage return means?
Are global variables initialized to zero?
Do I need java on my computer?
Which data type is a class in java?
How is a variable stored in memory?
What is final class?
what do you mean by marker interface in java?
public class Test { public static void main(String[] args) { int countA = 0; int countB = 0; int countC = 0; int countD = 0; int countE = 0; int countF = 0; int countG = 0; int countH = 0; int countI = 0; int countJ = 0; int countK = 0; int countL = 0; int countM = 0; int countN = 0; int countO = 0; int countP = 0; int countQ = 0; int countR = 0; int countS = 0; int countT = 0; int countU = 0; int countV = 0; int countW = 0; int countX = 0; int countY = 0; int countZ = 0; } } Can anybody tell me any alternate solution(like loop or something) to automate this initialization process. Ex:- for(char chr='A';chr<='Z'; chr++) { (int) String "count"+chr = 0; }
Why do we create threads in java?
What is polymorphism java example?
List primitive java types?
What is a boolean used for?
what is deadlock? : Java thread