0% found this document useful (0 votes)
37 views

Java Fundamentals

The document discusses key Java concepts related to the Java Virtual Machine (JVM), Java Runtime Environment (JRE), and Java Development Kit (JDK). It provides definitions and explanations of the JVM, JRE, and JDK. The JVM converts bytecode to machine code. The JRE provides a platform to execute Java programs and includes the JVM and classes needed to run programs. The JDK is the core Java environment and includes tools to compile, debug, and execute Java programs. Just-in-time (JIT) compilation in the JVM optimizes bytecode by compiling similar bytecode together to reduce compilation time. The document then lists several Java topics but does not provide any details on them.

Uploaded by

ganesh shinde
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Java Fundamentals

The document discusses key Java concepts related to the Java Virtual Machine (JVM), Java Runtime Environment (JRE), and Java Development Kit (JDK). It provides definitions and explanations of the JVM, JRE, and JDK. The JVM converts bytecode to machine code. The JRE provides a platform to execute Java programs and includes the JVM and classes needed to run programs. The JDK is the core Java environment and includes tools to compile, debug, and execute Java programs. Just-in-time (JIT) compilation in the JVM optimizes bytecode by compiling similar bytecode together to reduce compilation time. The document then lists several Java topics but does not provide any details on them.

Uploaded by

ganesh shinde
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

What is JVM, JRE, JDK?

JVM is responsible for converting Byte code to the machine specific code
JRE is the implementation of JVM, it provides a platform to execute java programs. JRE
consists of JVM and java binaries and other classes to execute any program successfully
JDK Java Development Kit is the core component of Java Environment and provides all the
tools, executables and binaries required to compile, debug and execute a Java Program

JIT – Sometimes we heard this term and being it a part of JVM it confuses us. JIT is
part of JVM that optimizes byte code to machine specific language compilation by
compiling similar byte codes at the same time, hence reducing overall time taken for
the compilation of byte code to machine specific language.

What is the JVM memory structure in RAM?

What is class in Java?

Every class in java extends Object class

Main method in all types of java classes interface, abstract, enum and normal class.

Normal Class can be created with only public, abstract, final and default access modifiers.

String memory management?


-----

Arrays in java

How to iterate any Map in Java

What is thread-safe collections? ConcurrentHashMap and LinkedBlockingQueue


PriorityBlockingQueue

Collections is a class in java and Collection is an interface in Java.


Differences
 Vectors are synchronized, ArrayLists are not.
 Data Growth Methods
Use ArrayLists if there is no specific requirement to use Vectors.

Synchronization
If multiple threads access an ArrayList concurrently then we must externally synchronize
the block of code which modifies the list either structurally or simply modifies an element.
Structural modification means addition or deletion of element(s) from the list. Setting the
value of an existing element is not a structural modification.

Collections.synchronizedList is normally used at the time of creation of the list to avoid


any accidental unsynchronized access to the list.
Reference
Data growth
Internally, both the ArrayList and Vector hold onto their contents using an Array. When an
element is inserted into an ArrayList or a Vector, the object will need to expand its internal
array if it runs out of room. A Vector defaults to doubling the size of its array, while the
ArrayList increases its array size by 50 percent.
Siders:

MultiMap | Guava | Java


Introduction : A Multimap is a general way to associate keys with arbitrarily many values.
Guava’s Multimap framework makes it easy to handle a mapping from keys to multiple
values. There are two ways to think of a Multimap conceptually :
1) As a collection of mappings from single keys to single values.
a -> 1
a -> 2
a -> 4
b -> 3
c -> 5

2) As a mapping from unique keys to collections of values.

a -> [1, 2, 4]
b -> [3]
c -> [5]

4) Why Map interface does not extend Collection interface?

A good answer to this interview question is “because they are incompatible“. Collection has
a method add(Object o). Map can not have such method because it need key-value pair.
There are other reasons also such as Map supports keySet, valueSet etc. Collection classes
does not have such views.

Due to such big differences, Collection interface was not used in Map interface, and it was
build in separate hierarchy.

Tag : java thread

Java ExecutorService examples


By mkyong | December 5, 2018 | Viewed : 30,476 | +1,080 pv/w

Java Thread – Mutex and Semaphore example


By Datsabk | December 4, 2016 | Viewed : 96,834 | +827 pv/w

Junit - https://www.mkyong.com/tutorials/junit-tutorials/

XML parsers - https://www.mkyong.com/tutorials/java-xml-tutorials/

You might also like