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

Java Interview Questions

This document provides an overview of key Java concepts including garbage collection, pass by value vs reference, static methods, the diamond problem, wrapper classes, abstract classes vs interfaces, constructors, lambda expressions, streams, collections, concurrency, and more. It discusses core Java topics at a high level and would serve as a starting point for understanding fundamental Java concepts and technologies.

Uploaded by

shyam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Java Interview Questions

This document provides an overview of key Java concepts including garbage collection, pass by value vs reference, static methods, the diamond problem, wrapper classes, abstract classes vs interfaces, constructors, lambda expressions, streams, collections, concurrency, and more. It discusses core Java topics at a high level and would serve as a starting point for understanding fundamental Java concepts and technologies.

Uploaded by

shyam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Garbage collection –cannot happen forcefully

Pass by value vs pass by reference

Static, can we override static methods?

Diamond problem

Wrapper classes

Abstract classes vs interfaces

Abstract method vs default method

Calling another constructor from constructor

New functionalities in java8 for interfaces

Finalise method

Final vs finally

String literals

String immutability

String pool

String Buffer vs String Builder

Advantage of immutable objects

Access modifiers
System.out.println(1+2+3+"hello"+5);

System.out.println(1+2+3+"hello"+5+6);

StringBuffer vs StringBuilder- performance,efficiency

Exceptions-checked and unchecked

How to handle exceptions?? Different ways

Exception throw in parent-child class

Exception order in child block

Array index out of bound


Use of throw keyword

Concurrency, what is it ,when , how ,why

Thread creation

When extending thread class what methods are overriden

Thread safety
Sync block

Synchr. Vs asynchronous

Collections(vvvvvvvvvvvvvvvvvvvvvvvvvvvvvip)

Comparator vs Comparable

Singleton class – in depth

how to break a Singleton pattern

Why declare constructor private in singleton class? –so not allow anyone to create
new obj

Anonymous classes

Lambda expressions, when to use them ,their return type

Stream API,advantages, different methods, how did u used it in your project

Normal stream vs parallel stream

Map vs flatMap (where used examples in project)

HashMaps working

Your project jdk version (new functionalities)

Stateless object

Concurrent HashMap

Notify and notifier

You might also like