🧰 What You Need to Get Started
Before we write any code, let’s set up everything you need.
🔸 Step 1: Install JDK (Java Development Kit)
-
Go to the Oracle JDK download page
-
Download and install the version suitable for your OS (Windows/Mac/Linux)
-
Add Java to your system’s PATH (most installers do this automatically)
🔸 Step 2: Install an IDE
An IDE (Integrated Development Environment) makes writing code easier.
Popular IDEs for Java:
-
VS Code with Java Extension Pack
▶️ Bangla Video Tutorial (Recommended)
Here’s a full Bangla video tutorial covering Java setup, IDE installation, and first project
Language: Bangla | Duration: ~4 mins
✅ Post 1: Introduction to Java
Preview that we will learn
1. Java Introduction
What is Java, why learn it, and how to run your first program.
2. Java Variables & Data Types
Learn about storing values and different types of data such as numbers, text, and booleans.
3. Java User Input with Scanner
Discover how to take input from users using the Scanner class.
4. Java If-Else Statements
Master decision-making in Java with simple if-else conditions.
5. Java Loops (for, while, do-while)
Learn how to repeat tasks using different looping structures.
6. Java Arrays
Store and manage multiple values using arrays.
7. Java Methods (Functions)
Write reusable blocks of code (methods), pass parameters, and return values.
8. Java Classes and Objects (OOP Basics)
Enter Object-Oriented Programming with classes as blueprints and objects as real-life instances.
9. Java Constructors
Understand how to initialize objects properly with constructors.
🔸 What is Java?
Java is a programming language. It is used to make apps, websites, games, and more.
🔸 Why Learn Java?
-
Easy to understand
-
Works on any computer
-
Used in companies around the world
🔸 Hello Java Program
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, Java!");
}
}
🔸 Output:
Hello, Java!
📺 Learn from YouTube:▶ English
▶ বাংলা
▶ हिंदी
CodeWithHarry
Apna college
✅ Post 2: Java Variables and Data Types
🔸 What is a Variable?
A variable stores data in a program. It’s like a box that holds a value.
🔸 Types of Variables:
-
int– for numbers (5, 10, 100) -
double– for decimal numbers (3.14, 5.5) -
String– for text ("Hello") -
boolean– true or false
🔸 Example:
int age = 25;
double pi = 3.14;
String name = "Tawsif";
boolean isJavaFun = true;
🔸 Output:
25
3.14
Tawsif
true
📺 Learn from YouTube:
▶ English
-
Variables – BroCode – BroCode
-
Java Basics – Mosh – Mosh
▶ বাংলা
-
Variables – Anisul Islam – Anisul Islam
-
Data Types – Sumit – Learn With Sumit
▶ हिंदी
-
Variables – CodeWithHarry – CodeWithHarry
-
Java Variables – Apna College – Apna College
✅ Post 3: Java Input from User
🔸 How to take input?
We use Scanner to take input from the user.
🔸 Example:
import java.util.Scanner;
public class InputExample {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter your name: ");
String name = sc.nextLine();
System.out.println("Hello, " + name + "!");
}
}
🔸 Output:
Enter your name: Tawsif
Hello, Tawsif!##From here on now Click the link bellow and you will get to the exact point you are loking for...
📺 Learn from YouTube:
▶ English
-
User Input – BroCode – BroCode
-
Taking Input – Mosh – Mosh
▶ বাংলা
-
Java Input – Anisul Islam – Anisul Islam
-
Scanner Class – Sumit – Sumit
▶ हिंदी
-
Java Input – CodeWithHarry – CodeWithHarry
-
Scanner Input – Apna College – Apna College
✅ Post 4: Java If-Else Statement
🔸 What is If-Else?
It helps to make decisions in a program.
🔸 Example:
int age = 18;
if (age >= 18) {
System.out.println("You are an adult.");
} else {
System.out.println("You are a child.");
}
🔸 Output:
You are an adult.
📺 Learn from YouTube:
▶ English
-
If Else – BroCode – BroCode
▶ বাংলা
-
If Else – Anisul Islam – Anisul Islam
▶ हिंदी
-
If Else – CodeWithHarry – CodeWithHarry
✅ Post 5: Java Loops – for, while, do-while
🔸 What is a Loop?
A loop runs code again and again.
🔸 Types of Loops in Java:
-
forloop – runs a fixed number of times -
whileloop – runs while the condition is true -
do-whileloop – runs at least once
🔸 Example – for loop
for (int i = 1; i <= 5; i++) {
System.out.println("Number: " + i);
}
Output:
Number: 1
Number: 2
Number: 3
Number: 4
Number: 5
🔸 Example – while loop
int i = 1;
while (i <= 3) {
System.out.println("Hello");
i++;
}
🔸 Example – do-while loop
int i = 1;
do {
System.out.println("Run at least once");
i++;
} while (i <= 1);
📺 Learn from YouTube:
▶ English
-
Loops in Java – BroCode – BroCode
-
Loops Explained – Mosh – Mosh
▶ বাংলা
-
Java Loop Tutorial – Anisul Islam – Anisul Islam
▶ हिंदी
-
Loops in Java – CodeWithHarry – CodeWithHarry
-
Java Loops Full – Apna College – Apna College
✅ Post 6: Java Arrays – Store Multiple Values
🔸 What is an Array?
An array stores many values in one variable.
🔸 Example:
int[] numbers = {10, 20, 30, 40};
for (int i = 0; i < numbers.length; i++) {
System.out.println(numbers[i]);
}
Output:
10
20
30
40
📺 Learn from YouTube:
▶ English
-
Java Arrays – BroCode – BroCode
-
Arrays for Beginners – Mosh – Mosh
▶ বাংলা
-
Java Arrays Bangla – Anisul Islam – Anisul Islam
-
Java Array Example – Sumit – Sumit
▶ हिंदी
-
Java Arrays Explained – CodeWithHarry – CodeWithHarry
-
Array in Java – Apna College – Apna College
✅ Post 7: Java Methods (Functions)
🔸 What is a Method?
A method is a block of code that runs when called.
It helps you write clean and reusable code.
👉 Think of it like a mini-program inside your program.
🔸 Why Use Methods?
-
To avoid repeating code
-
To break your program into small parts
-
To make code clean and easy to understand
🔸 Example: Method without return
public class Main {
public static void sayHello() {
System.out.println("Hello from method!");
}
public static void main(String[] args) {
sayHello(); // calling the method
}
}
Output:
Hello from method!
🔸 Example: Method with parameters
public class Main {
public static void greet(String name) {
System.out.println("Hello, " + name);
}
public static void main(String[] args) {
greet("Tawsif");
}
}
Output:
Hello, Tawsif
🔸 Example: Method with return value
public class Main {
public static int add(int a, int b) {
return a + b;
}
public static void main(String[] args) {
int result = add(5, 3);
System.out.println("Sum: " + result);
}
}
Output:
Sum: 8
📺 Learn from YouTube:
▶ English
-
Java Methods – BroCode – BroCode
-
Functions in Java – Mosh – Mosh
▶ বাংলা
-
Java Methods Bangla – Anisul Islam – Anisul Islam
-
Functions Tutorial – Sumit – Learn With Sumit
▶ हिंदी
-
Functions in Java – CodeWithHarry – CodeWithHarry
-
Java Methods – Apna College – Apna College
🧠 Summary
-
A method is a block of reusable code
-
void= no return, usereturnto send data back -
You can pass data using parameters
✅ Post 8: Java Classes and Objects (Start of OOP)
🔸 What is a Class?
A class is like a blueprint for creating objects.
It defines the properties (variables) and actions (methods) an object can have.
🔸 Example of a Class:
public class Car {
String color;
String model;
void drive() {
System.out.println("Driving the car!");
}
}
🔸 What is an Object?
An object is an instance of a class.
It contains actual data for the class and can perform actions.
🔸 Example of Creating an Object:
public class Main {
public static void main(String[] args) {
Car myCar = new Car(); // Creating an object of Car
myCar.color = "Red"; // Assigning values
myCar.model = "Tesla";
System.out.println("Car Model: " + myCar.model);
System.out.println("Car Color: " + myCar.color);
myCar.drive(); // Calling method of Car
}
}
Output:
Car Model: Tesla
Car Color: Red
Driving the car!
🔸 Constructor in Java
A constructor is a special method that runs when an object is created.
It’s used to initialize the object's properties.
🔸 Example of Constructor:
public class Car {
String color;
String model;
// Constructor
Car(String c, String m) {
color = c;
model = m;
}
void drive() {
System.out.println("Driving the " + model + "!");
}
}
public class Main {
public static void main(String[] args) {
Car myCar = new Car("Blue", "BMW"); // Using constructor
System.out.println("Car Model: " + myCar.model);
System.out.println("Car Color: " + myCar.color);
myCar.drive();
}
}
Output:
Car Model: BMW
Car Color: Blue
Driving the BMW!
📺 Learn from YouTube:
▶ English
-
Java Classes & Objects – BroCode – BroCode
-
OOP Concepts – Mosh – Mosh
▶ বাংলা
-
Java Classes – Anisul Islam – Anisul Islam
-
OOP in Java – Sumit – Learn With Sumit
▶ हिंदी
-
Java Classes & Objects – CodeWithHarry – CodeWithHarry
-
OOP Concepts – Apna College – Apna College
🧠 Summary
-
Class is a blueprint for creating objects.
-
Object is an instance of a class, and it holds data.
-
Constructor initializes an object when created.
🔸 Summary of What We Learned So Far:
-
Java Introduction:
-
Java is a popular programming language used to create various applications.
-
It is platform-independent, meaning code can run anywhere (on any device).
-
-
Variables & Data Types:
-
Java uses variables to store values like numbers, text, and more.
-
Different types of data include
int(numbers),String(text),boolean(true/false), anddouble(decimal numbers).
-
-
User Input (Scanner):
-
You can take input from the user using the
Scannerclass. -
Example: Asking the user for their name and greeting them.
-
-
If-Else Statements:
-
Used for decision-making in programs.
-
Example: Checking if a person is an adult or a child.
-
-
Loops (for, while, do-while):
-
Loops help you repeat tasks multiple times.
-
Types:
forloop,whileloop, anddo-whileloop.
-
-
Arrays:
-
Arrays store multiple values in a single variable.
-
Example: Storing and printing a list of numbers.
-
-
Methods (Functions):
-
Methods are reusable blocks of code that can be called multiple times.
-
You can pass data (parameters) and even return a value from methods.
-
-
Classes and Objects (OOP Basics):
-
A class is like a blueprint, and an object is an instance of that class.
-
Objects have properties (variables) and behaviors (methods).
-
