InterviewSolution
| 1. |
ByteCode in Java |
|
Answer» During compile time, the Java Compiler CONVERTS the Source Code into the ByteCode. ByteCode is a highly developed set of instructions given to the Java Virtual Machine to generate the machine code. It is the machine code in the form of the .class file. Analogies can be made to the assembler in C++. It is CALLED ByteCode because each INSTRUCTION is of 1-2 bytes. One of the main features in Java which distinguishes it from other Object-Oriented Languages is that it is Platform Independent. This Platform Independence is achieved through the Java ByteCode. The COMPONENTS required to execute the bytecode are provided by the Java Virtual Machine, which invocates the processor to allot the needed resources. JVMs are based on stacks so they implement stacks to READ and process the bytecode. Some ByteCode instructions are as follows: 1: istore_1 2: iload_1 3: sipush 1000 6: if_icmpge 44 9: iconst_2 10: istore_2The Code Segment is the memory segment that holds the ByteCode. |
|