♨️Complete Java Programming Tutorial for Beginners: Learn Java from Scratch

Start learning Java with this step-by-step tutorial. Covers Java basics, syntax, and practical examples for absolute beginners.



🧰 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)

  1. Go to the Oracle JDK download page

  2. Download and install the version suitable for your OS (Windows/Mac/Linux)

  3. 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:

▶️ 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


 BroCode



Mosh Hamedani


▶ বাংলা


Anisul Islam


▶ हिंदी


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

▶ বাংলা

▶ हिंदी


✅ 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

▶ বাংলা

▶ हिंदी



✅ 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

▶ বাংলা

▶ हिंदी



✅ Post 5: Java Loops – for, while, do-while


🔸 What is a Loop?

A loop runs code again and again.


🔸 Types of Loops in Java:

  1. for loop – runs a fixed number of times

  2. while loop – runs while the condition is true

  3. do-while loop – 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

▶ বাংলা

▶ हिंदी


✅ 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

▶ বাংলা

▶ हिंदी


✅ 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

▶ বাংলা

▶ हिंदी


🧠 Summary

  • A method is a block of reusable code

  • void = no return, use return to 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

▶ বাংলা

▶ हिंदी


🧠 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:

  1. 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).

  2. 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), and double (decimal numbers).

  3. User Input (Scanner):

    • You can take input from the user using the Scanner class.

    • Example: Asking the user for their name and greeting them.

  4. If-Else Statements:

    • Used for decision-making in programs.

    • Example: Checking if a person is an adult or a child.

  5. Loops (for, while, do-while):

    • Loops help you repeat tasks multiple times.

    • Types: for loop, while loop, and do-while loop.

  6. Arrays:

    • Arrays store multiple values in a single variable.

    • Example: Storing and printing a list of numbers.

  7. 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.

  8. 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).

Post a Comment

© By Tawsif. All rights reserved. Premium By Raushan Design
`; paragraphs[0].after(ad); // Inject after 1st paragraph } } }); Click here