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  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
why java is platform independent?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: why java is platform independent?
Answer
# 1
Java is compiled to an intermediate form called byte-code. 
A Java program never really executes natively on the host 
machine. Rather a special native program called the Java 
interpreter reads the byte code and executes the 
corresponding native machine instructions. Thus to port 
Java programs to a new platform all that is needed is to 
port the interpreter and some of the library routines. Even 
the compiler is written in Java. The byte codes are 
precisely defined, and remain the same on all platforms.
 
Is This Answer Correct ?    10 Yes 2 No
Guest
 
  Re: why java is platform independent?
Answer
# 2
java is platform independent as JVM compiles source code to 
its byte code which is then interpreted to object code.thus 
any machine having a java compiler can execute that byte 
code.this does not depends on the hardware or the OS of the 
system
 
Is This Answer Correct ?    9 Yes 5 No
Gunjan
 
 
 
  Re: why java is platform independent?
Answer
# 3
java have java virtual machine which make java plateform
independent..jvm convert input source code into bye code
which is run on any plateform..
 
Is This Answer Correct ?    3 Yes 6 No
Asha
 
  Re: why java is platform independent?
Answer
# 4
yes java is a platform independent. JVM(java virtual
machine) is used in java , that jvm can be converted source
code into byte code so java known as platform independent.
 
Is This Answer Correct ?    4 Yes 6 No
Madhan
 
  Re: why java is platform independent?
Answer
# 5
JVM does not compile Java source code to byte code. It is 
the Java Compiler which does that. JVM runs on the target 
machine which interprets the byte code and runs the program 
on the target machine.   

Java is not platform independent. Though you write the Java 
source code, somebody else ( Sun Microsystems ) have done 
the hardwork to implement JVM for the platform which is 
going to run your program. "Java is Platform Independent" 
is an illusion.
 
Is This Answer Correct ?    6 Yes 3 No
Coder
 
  Re: why java is platform independent?
Answer
# 6
Java was designed to not only be cross-platform in source 
form like C, but also in compiled binary form. Since this 
is frankly impossible across processor architectures Java 
is compiled to an intermediate form called byte-code. A 
Java program never really executes natively on the host 
machine. Rather a special native program called the Java 
interpreter reads the byte code and executes the 
corresponding native machine instructions. Thus to port 
Java programs to a new platform all that is needed is to 
port the interpreter and some of the library routines. Even 
the compiler is written in Java. The byte codes are 
precisely defined, and remain the same on all platforms. 

The second important part of making Java cross-platform is 
the elimination of undefined or architecture dependent 
constructs. Integers are always four bytes long, and 
floating point variables follow the IEEE 754 standard for 
computer arithmetic exactly. You don't have to worry that 
the meaning of an integer is going to change if you move 
from a Pentium to a PowerPC. In Java everything is 
guaranteed.
 
Is This Answer Correct ?    1 Yes 3 No
Dinesh Haridoss
 
  Re: why java is platform independent?
Answer
# 7
java is platform independent because the virtual machine
include all operating system,so java is run on any platform

java compiler converted source code into byte code,then the
jvm to translate the byte code into machine code
 
Is This Answer Correct ?    1 Yes 4 No
Suresh
 
  Re: why java is platform independent?
Answer
# 8
Bismillahir Rahmanir Rahim..
yes java is plateform independent, because its compiler 
first convert the java code into byte-code(machine 
language), which is the code that every plateform 
understand, that's why it is called " plateform independent"
 
Is This Answer Correct ?    0 Yes 3 No
Asad Raza
 
  Re: why java is platform independent?
Answer
# 9
java compiler makes the class file which is not dependent 
on the hardware or software of the system where we compiled.
Every system has its own JVM(System dependent) and will 
takes .class file and produces the code which is executable 
on that particular system itself. 
So JVM makes the code portability.
hence JVM makes the JAVA as Platform Independent.
JAVA-JVM=NO USE of producing System indipendent code.
 
Is This Answer Correct ?    0 Yes 0 No
Jagan_kumar
 
  Re: why java is platform independent?
Answer
# 10
java uses two process compiler and second one interpreter
compiler converted source code in to byte code and this byte code is universalize because it can be run by any jvm(java virtual machine).which is a interpreter
suppose u create a java programe in windows and u compile it then u have their byte code*(.class file)as discussion it can be run on any jvm means(linx )
 
Is This Answer Correct ?    0 Yes 0 No
Pawan Mangal
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }  1
Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);  1
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }  1
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }  1
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped IBM1
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }  1
Write a C function to search a number in the given list of numbers. donot use printf and scanf Honeywell4
main() { int i=10; i=!i>14; Printf ("i=%d",i); }  1
How to swap two variables, without using third variable ? HCL45
how to check whether a linked list is circular.  3
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above HCL1
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }  1
main() { { unsigned int bit=256; printf("%d", bit); } { unsigned int bit=512; printf("%d", bit); } } a. 256, 256 b. 512, 512 c. 256, 512 d. Compile error HCL1
void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }  1
how can u draw a rectangle in C Wipro31
Program to find the largest sum of contiguous integers in the array. O(n)  7
main() { show(); } void show() { printf("I'm the greatest"); }  1
void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a. 10, 10 b. 10, 9 c. 10, 11 d. none of the above HCL1
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }  1
Derive expression for converting RGB color parameters to HSV values  1
 
For more C Code 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