Category: 1. Basics Interview Questions
-
What gives Java its ‘write once and run anywhere’ nature?
The bytecode. Java compiler converts the Java programs into the class file (Byte Code) which is the intermediate language between source code and machine code. This bytecode is not platform specific and can be executed on any computer.
-
What are the main differences b/w the Java platform and other platforms?
There are the following differences between the Java platform and other platforms. Java is the software-based platform whereas other platforms may be the hardware platforms or software-based platforms. Java is executed on the top of other hardware platforms whereas other platforms can only have the hardware components.
-
What is the platform?
A platform is the hardware or software environment in which a piece of software is executed. There are two types of platforms, software-based and hardware-based. Java provides the software-based platform.
-
What is JIT compiler?
Just-In-Time(JIT) compiler: It is used to improve the performance. JIT compiles parts of the bytecode that have similar functionality at the same time, and hence reduces the amount of time needed for compilation. Here the term “compiler” refers to a translator from the instruction set of a Java virtual machine (JVM) to the instruction set of…
-
How many types of memory areas are allocated by JVM?
Many types: Class(Method) Area: Class Area stores per-class structures such as the runtime constant pool, field, method data, and the code for methods. Heap: It is the runtime data area in which the memory is allocated to the objects Stack: Java Stack stores frames. It holds local variables and partial results, and plays a part in method invocation…
-
What is the difference between JDK, JRE, and JVM?
JVM JVM is an acronym for Java Virtual Machine; it is an abstract machine which provides the runtime environment in which Java bytecode can be executed. It is a specification which specifies the working of Java Virtual Machine. Its implementation has been provided by Oracle and other companies. Its implementation is known as JRE. JVMs…
-
What do you understand by Java virtual machine?
Java Virtual Machine is a virtual machine that enables the computer to run the Java program. JVM acts like a run-time engine which calls the main method present in the Java code. JVM is the specification which must be implemented in the computer system. The Java code is compiled by JVM to be a Bytecode which…
-
List the features of Java Programming language.
There are the following features in Java Programming Language. Simple: Java is easy to learn. The syntax of Java is based on C++ which makes easier to write the program in it. Object-Oriented: Java follows the object-oriented paradigm which allows us to maintain our code as the combination of different type of objects that incorporates both data…
-
What are the differences between C++ and Java?
The differences between C++ and Java are given in the following table. Comparison Index C++ Java Platform-independent C++ is platform-dependent. Java is platform-independent. Mainly used for C++ is mainly used for system programming. Java is mainly used for application programming. It is widely used in window, web-based, enterprise and mobile applications. Design Goal C++ was designed for…
-
What is Java?
Java is the high-level, object-oriented, robust, secure programming language, platform-independent, high performance, Multithreaded, and portable programming language. It was developed by James Gosling in June 1991. It can also be known as the platform as it provides its own JRE and API.