You are on page 1of 2

Java intervie questions

JIT ?
Abbrevioation of Just in time. It compiles code to Machine level directly for
higher speed of code execution

Classloader ?
Classloader je podsistem JVM koji se koristi za učitavanje class fajlova.
Classloader is a subsystem of JVM which is using for loading class files.

Memory allocations ?
Class memory
Heap memory
Stack memory
Program counter memory
Native method stack memory

Code snipped ?
System.out.println(100+100+"nesto") //200nesto
System.out.println("nesto"+100+100) //nesto100100

Asocijacija ?
Veza izmedju dvije klase gdje nijedna nije owner ili parent. Connection between
classes that neither of two are not owner or parent.

Copy constructor ?
A copy constructor in a Java class is a constructor that creates an object using
another object of the same Java class.

Marker interface ?
In other words, an empty interface is known as marker interface or tag interface.
It delivers the run-time type information about an object. It is the reason that
the JVM and compiler have additional information about an object.
The Serializable and Cloneable interfaces are the example of marker interface.

Object cloning ?
The object cloning is a way to create exact copy of an object.
The clone() method of Object class is used to clone an object.

why java is not 100 object-oriented ?


Java is not fully object oriented because it supports primitive data type like
it,byte,long etc.,which are not objects.
All operations performed on objects must be only through methods exposed at the
objects.

wrapper class ?
The wrapper class in Java provides the mechanism to convert primitive into object
and object into primitive.

singleton class ?
In object-oriented programming, a singleton class is a class that can have only one
object (an instance of the class) at a time.
It can be created setting private keyword on constructor.

Package ?
Package is a mechanism to group related classes ,interfaces and enums
in to a single module.

Varijable ?
Lokalne varijable
Varijabla koja je deklarisana unutar metoda se naziva lokalna varijabla.

Instansna varijabla
Varijabla koja je deklarisana unutar klase ali izvan metoda se naziva instansna
varijabla. Nije deklarisana kao statička.

Statička varijabla
Varijabla koja je deklarisana kao statička se naziva statička varijabla. Ona ne
može biti lokalna.

String pool ?
String uses a special memory location
to reuse of String objects called String Constant Pool.
String objects created without
the use of new keyword are stored in the
String Constant Pool part of the heap.
It doesn't create the same string object
if there is already string constant in the pool.

Exception
In Java “an event that occurs during the execution of a program that disrupts the
normal flow of instructions” is called an exception.

Final keyword?
Final is used to apply restrictions on class, method, and variable.
The final class can't be inherited, final method can't be overridden,
and final variable value can't be changed. Final is a keyword

JDK?
The JDK is a development environment for building applications, applets, and
components using the Java programming language.
The JDK includes JRE and tools useful for developing and testing programs written
in the Java programming language and running on the Java platform.

You might also like