JAVA FAQs

What is the most important feature of Java?

Java is platform independent


Is JVM platform independent?

JVM is not platform independent. JVM's are platform specific run time implementation.


Why Java is not pure object-oriented?

Java uses primitive data types such as boolean, byte, char, short, int, long, float, double which are not objects.


Why Java doesn't support pointers?

Pointer is a reference handle to a memory location. Improper handling of pointers leads to memory leaks and reliability issues hence Java doesn't support the usage of pointers.


What is difference between Path and Classpath?

Path and Classpath are environment variables in Operating System. Path is used to specify the locations of .exe files whereas classpath specify .class files.


How does Java enable high performance?

Java uses Just-In-Time(JIT) compiler to enable high performance.


What is JIT compiler in Java?

JIT compiler is a program that turns Java bytecode into instructions that can be sent directly to the processor.


What is the difference between local variable and instance variable?

Local variables are defined in the method or block and the scope of those variables within the method or block.
Instance variables are defined inside the class and outside the method and scope of these variables throughout the class.


What are access modifiers in Java?

Access modifiers in Java helps to restrict the scope of a class, constructor, variable and method. There are four types of access modifiers:

  1. Default
  2. Private
  3. Protected
  4. Public


How to define a constant variable in Java?

The variable should be declared as static and final. So only one copy of the variable exists for all instances of the class and the value can't be changed also.

Next


No comments:

Post a Comment

Total Pageviews