Java: From Zero to Your First Program!
A Beginner’s Guide to Building with the World’s Most Versatile Language
What is Java?
A Powerful, All-Purpose Language
"Write Once, Run Anywhere" (WORA).
Java runs on almost any device, making it powerful and versatile.
Why Learn Java?
🧠 Object-Oriented
🌍 Platform Independent
👥 Huge Community
Secure & Reliable
Java is Everywhere!
Netflix, LinkedIn, Android, banking apps, scientific computing, and
Minecraft.
JDK, JRE, JVM
JDK: Full developer toolkit
JRE: Runs Java applications
JVM: Executes Java bytecode
Your First Java Program
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Dissecting the Code
public: accessible
class: blueprint
main(): where execution starts
System.out.println(): prints to output
Primitive Types
int: whole numbers
char: single character
boolean: true/false
double: decimal
Declaring Variables
Syntax: [Type] [Name] = [Value];
Example: int age = 25;
Arithmetic Operators
+, -, *, /, %
Example: 10 % 3 = 1 (remainder)
Relational Operators
Compare values:
10 > 5 → true
10 == 5 → false
Logical Operators
&&: both conditions true
||: at least one true
! : negation
Unary Operators
++score: pre-increment
score++: post-increment
Challenge
Write a program to calculate simple interest:
P * R * T / 100
Practice Builds Skill
The more code you write, the more fluent you'll become.
Think of Java like LEGO bricks — build one block at a time.
Recommended Resources
📘 Head First Java
🌐 Oracle Docs
🌐 GeeksforGeeks
🌐 W3Schools
Thank You!
Happy Coding!
Questions? Let's discuss!