ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
How java is platform independent?
 Question Submitted By :: Sushil
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How java is platform independent?
Answer
# 1
In the classic sense of software development, programs are
coded in higher level languages such as C/C++, then that
source code needs to be compiled into native machine
language specific to that platform so that the program is
made executable.

Java compiler on the other hand does not compile Java source
files into native machine language, instead it compiles the
source code into bytecodes. These bytecodes are platform
independant i.e. in other words specific to to the Java
Virtual Machine specification. This enables platform
independant compilation.

When the bytecode compiled programs are executed thru the
Java interpeter, it converts those bytecodes into native
machine code and executes them thru the JVM which is
specific to host environment it is running on. This enables
platform specific execution.
 
Is This Answer Correct ?    41 Yes 7 No
Ranganathkini
 
  Re: How java is platform independent?
Answer
# 2
Hi... Java is a platform independent language.After 
compiling the ".java" file ,that will be converting into 
the ".class" file,which is a byte code having the 
capability run on any OS.Basing on the concept byte code 
java achieving the platform independent,it leads to "Write 
onece run anyware".
 
Is This Answer Correct ?    35 Yes 5 No
Devarathnam C,kotagudibanda(po
 
 
 
  Re: How java is platform independent?
Answer
# 3
jvm is used to any platform converted.
 
Is This Answer Correct ?    3 Yes 15 No
Guest
 
  Re: How java is platform independent?
Answer
# 4
Java is plateform independent language because it is not 
tied to any hardware or any operating system. The program 
made in java can be run anywhere or any machine.
 
Is This Answer Correct ?    5 Yes 6 No
Padam Jeet Singh
 
  Re: How java is platform independent?
Answer
# 5
When you write the program for any programming language it 
is called (source program), and it will have the extension 
depending upon the language. For example, the C language 
will have the extension ".c" and ".cpp" in C++.
When you compile the file or (source program), you will get 
the ".exe" extension. This ".exe" file is executed by the 
operating system in the C & C++ program.
If you are writing the program and compile it in one 
operating system, you cannot take the same ".exe" file to 
another operating system for extension. That means, this 
program depends upon the operating system for its execution.

In Java, when you write the program, you will have 
the ".java" file. And when it is compiled, you will get 
the ".class" file. The ".class" file is executed by the 
Java Virtual Machine (JVM). If you have the JVM, you can 
execute the java program anywhere under operating system.
That means, that Java is PLATFORM INDEPENDENT.
 
Is This Answer Correct ?    25 Yes 2 No
Invisible
 
  Re: How java is platform independent?
Answer
# 6
when java code is compiled a bytecode is generated which is 
independent of the system.This bytecode is fed to the JVM
(java virtual machine)which is resided in the system.Since 
every system has its own JVM,it does'nt matter where u 
compile the source code.The bytecode generated by the 
compiler can be interpreted by any JVM of any machine.
 
    Hence it is called platform-indepented language.
 
Is This Answer Correct ?    7 Yes 1 No
Rinky Sharma
 
  Re: How java is platform independent?
Answer
# 7
java is platform independent due to the concept of J.I.T
after compilation of java source code filename.class file
prepared by the J.V.M is called bytecode but j.v.m is
platform dependent that bytecode is further interpreate by
J.I.T in the machine code
by this process java becomes platform independent
 
Is This Answer Correct ?    0 Yes 11 No
Jitesh Singh
 
  Re: How java is platform independent?
Answer
# 8
java is a platform oriented  language ,because it' not tied
to any os and hardwares. it can  run any os at any time.
 
Is This Answer Correct ?    1 Yes 1 No
Pavi
 
  Re: How java is platform independent?
Answer
# 9
A language is platform independant if it satisfies the 
following 3 conditions : 

1. It is compiled in a platform neutral manner i.e. object 
code obtained after compilation doesn't contain any 
Operating System specific information and doesn't follow 
O.S. specification formats.

2. Language provides its own runtime environment for 
execution of its applications.

3. Language provides comprehensive library to act as an 
interface for O.S. services i.e. applications developed in 
the language doesn't directly reference any O.S. specific 
functionality.

Java follows all these conditions.
 
Is This Answer Correct ?    0 Yes 2 No
Shobhit Sachdeva
 
  Re: How java is platform independent?
Answer
# 10
Platform Independent means the process in which certain 
languages is capable of running on all types of Operating 
System.
      Java is platform independent bcoz In java when we 
execute the source code,it generates the class file 
comprising the bytecode.Byte code are easily interpreted by 
JVM(interpreter)which is available with every type of O.S 
we install
 
Is This Answer Correct ?    2 Yes 1 No
Bandana Mankotia
 
  Re: How java is platform independent?
Answer
# 11
I am giving the answer more clear.
JVM is O.S Dependent ,i.e different operating systems require
their own specific jvm.

the thing what is platform independent is 
the byte code generated by java compiler "javac"
this byte code can be run on any real world object as long as
jre(consists jvm) is exists.jre should be under some
operating system.
 
Is This Answer Correct ?    2 Yes 1 No
Vinay
 
  Re: How java is platform independent?
Answer
# 12
java is platform independent because it follows the three
basic rules 
According to these rule there should not any coupling
between operating system and java program /application
1:-Application developing time coupling 
JAVA never use any operating system function in developing
java application
2 compilation time coupling
that is only Java Run Time environment is responsible to
load and compile the any java program
hence there is no role of operating system 
3:-Execution time coupling
in java Run Time environment JVM has responsibility to
execute the java program hence there is no role of OS
since java follow these three rule hence java is a platform
language
 
Is This Answer Correct ?    0 Yes 0 No
Brajesh Nath Tripathi
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Can we access private data outside of the class directly in java programming language? Why There is no runtime checking in java, which leads to access the private data directly outside of a class? Google2
What is the need of "creating and throwing an UserdefinedException" when the "Exception" class is already available?  4
What is stop(), suspend(), resume() method?  3
Can we declare an anonymous class as both extending a class and implementing an interface? Wipro7
Can we place the any object to key attribute of HashMap<key,value>? HCL3
They had given one progam final HashMap hm=new HashMap(); public void show() { hm.put("name",value); } in this prg here the final hashtable value can be changed in put method,its the prg run? DNS2
What is a J2EE component? List out all the component? Adobe2
why marker interfaces are there in java Digital-Group3
Why non nested classes in java are not having marked as protected access specifier Google1
how can u handle run time exception in java? explain with brief explanation with examples? CTS2
Hi buddy, well i got that there is always a default constructor with abstract class. OK. But why not with interface? Thanks in advance.  2
How are Observer and Observable used?  2
what is meaning of JIT?  4
Diff between C++ and java? TCS8
what is life cycle of applet?  4
question on Thread synchronization Huawei1
What is difference between Iterator and for loop  4
Explain method overloading and overriding?  6
What is yielding and sleeping? how they different?  2
Can an anonymous class be declared as implementing an interface and extending a class?  1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com