0% found this document useful (0 votes)
4 views2 pages

Core Java Interview Guide

The document is a Core Java Interview Preparation Guide for candidates with 3 years of experience, covering essential topics such as data types, arrays, strings, OOP concepts, exception handling, collections, and multithreading. It includes definitions, examples, and common interview questions with answers for each topic. The guide aims to help candidates prepare effectively for Java-related interviews.

Uploaded by

kd2544434
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)
4 views2 pages

Core Java Interview Guide

The document is a Core Java Interview Preparation Guide for candidates with 3 years of experience, covering essential topics such as data types, arrays, strings, OOP concepts, exception handling, collections, and multithreading. It includes definitions, examples, and common interview questions with answers for each topic. The guide aims to help candidates prepare effectively for Java-related interviews.

Uploaded by

kd2544434
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

Core Java Interview Preparation Guide

(3 Years Experience)
1. Data Types & Variables
Data types define the type of data a variable can hold. Java has primitive and non-primitive
types.
Primitive: int, float, double, char, boolean
Example:
int a = 10;

Why: Helps JVM allocate memory efficiently.

Interview Q: What is the difference between int and Integer?


Answer: int is primitive, Integer is wrapper class.

2. Arrays
Array is a collection of similar elements stored in contiguous memory.
Example:
int[] arr = {1,2,3};

Execution: arr[0]=1, arr[1]=2

Interview Q: Difference between array and ArrayList?


Answer: Array is fixed size, ArrayList is dynamic.

3. Strings
String is immutable in Java.
Example:
String s = "hello";

Why immutable: Security, performance.

Interview Q: String vs StringBuilder?


Answer: String is immutable, StringBuilder is mutable.
4. OOP Concepts
Encapsulation: Binding data and methods
Inheritance: Acquiring properties
Polymorphism: Many forms
Abstraction: Hiding details

Interview Q: What is polymorphism?


Answer: Method overloading and overriding.

5. Exception Handling
Used to handle runtime errors.
Example:
try { int a = 10/0; } catch(Exception e) {}

Interview Q: Checked vs Unchecked?


Answer: Checked at compile time vs runtime.

6. Collections
List, Set, Map
ArrayList vs LinkedList
HashMap internal working uses hashing.

Interview Q: HashMap internal working?


Answer: Uses hashcode and bucket.

7. Multithreading
Allows concurrent execution.
Example:
Thread t = new Thread();

Interview Q: Difference between process and thread?


Answer: Process is independent, thread is lightweight.

You might also like