Our website is made possible by displaying online advertisements to our visitors.Please consider supporting us by disabling your ad blocker.
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Translate it in your own Language

Print this Job Post

Print Friendly and PDF

Monday, May 26, 2014

Core Java Interviews Questions

Question-1:  What is difference between JDK,JRE and JVM?
Answer:

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.
  • JVMs are available for many hardware and software platforms (so JVM is platform dependent).

JRE:

JRE stands for Java Runtime Environment. It is the implementation of JVM and physically exists.

JDK:

JDK is an acronym for Java Development Kit. It physically exists. It contains JRE + development tools.


Question-2:  How many types of memory areas are allocated by JVM?
Answer:



  1. Class(Method) Area
  2. Heap
  3. Stack
  4. Program Counter Register
  5. Native Method Stack


Question:3- What is JIT compiler?
Answer:
Just-In-Time(JIT) compiler:It is used to improve the performance. JIT compiles parts of the byte code 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 a specific CPU.


Question-4: What is platform?
Answer:
A platform is basically the hardware or software environment in which a program runs. There are two types of platforms software-based and hardware-based. Java provides software-based platform.


Question-5: What is the main difference between Java platform and other platforms?
Answer
The Java platform differs from most other platforms in the sense that it’s a software-based platform that runs on top of other hardware-based platforms.It has two components:

Runtime Environment

API(Application Programming Interface)


Question-6: What gives Java its ‘write once and run anywhere’ nature?
Answer:
The bytecode. Java is compiled to be a byte code which is the intermediate language between source code and machine code. This byte code is not platorm specific and hence can be fed to any platform.


Question-7: What is classloader?

Answer:
The classloader is a subsystem of JVM that is used to load classes and interfaces.There are many types of classloaders e.g. Bootstrap classloader, Extension classloader, System classloader, Plugin classloader etc.


Question-8: Is Empty .java file name a valid source file name?
Answer:
Yes, save your java file by .java only, compile it by javac .java and run by java yourclassname Let’s take a simple example:

//save by .java only

class A{

public static void main(String args[]){ System.out.println(“Hello java”);

}

}

//compile by javac .java //run by java A compile it by javac .java run it by java A


Question-9: Is delete,next,main,exit or null keyword in java?
Answer:
No.


Question-10: If I do not provide any arguments on the command line, then the String array of Main method will be empty or null?
Answer:
It is empty. But not null.


Question-11: What if I write static public void instead of public static void?
Answer:
Program compiles and runs properly.


Question-12: What is the default value of the local variables?
Answer: 
The local variables are not initialized to any default value, neither primitives nor object references.

 Core Java – OOPs Concepts: Initial OOPs Interview Questions

2 comments:

  1. cant i download the whole questions at a time??

    ReplyDelete
    Replies
    1. yes you can
      there is a button (print pdf) on every page click on that button then click on pdf after that you can download whole page content as pdf

      Delete

Copyright @ CrackMNC 2014-2024
Divas Nikhra Theme by Crack MNC