Core Java Basics + Interview Questions (Sample Preview)
1. Introduction to Java
------------------------
Java is a high-level, class-based, object-oriented programming language. It is designed to have as few imp
Key Features of Java:
- Platform Independent
- Object-Oriented
- Robust and Secure
- Multithreaded
- High Performance
JVM, JRE, and JDK:
- JVM (Java Virtual Machine): Executes Java bytecode.
- JRE (Java Runtime Environment): Provides libraries and JVM for running Java applications.
- JDK (Java Development Kit): Contains tools to compile and run Java code.
2. Java Basics
--------------
Java Data Types:
- Primitive: int, float, double, boolean, char, byte, short, long
- Non-Primitive: String, Arrays, Classes
Control Statements:
- Conditional: if, if-else, switch
- Looping: for, while, do-while
3. Object-Oriented Programming
------------------------------
Principles:
- Encapsulation
- Inheritance
- Polymorphism
- Abstraction
Example:
class Car {
String model;
int year;
void display() {
System.out.println(model + " - " + year);
4. Sample Interview Questions
-----------------------------
Q1. What is JVM?
A: JVM is a part of JRE that executes Java bytecode on any machine.
Q2. Difference between Overloading and Overriding?
A: Overloading is static binding, while Overriding is dynamic binding.
(Note: Full content will contain 50 pages of topics, examples, and interview Q&A.)