cd ..
cat java-for-beginners.mdx

Java for Beginners

An introduction to Java programming for beginners.

2026-04-181 min read
javaprogrammingbeginners

Java for Beginners

Java is one of the most popular programming languages in the world. Let's learn the basics!

Why Learn Java?

- Platform independent (Write Once, Run Anywhere) - Object-oriented - Strong community support - Used in enterprise applications - Android development

Your First Java Program

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

Basic Concepts

Variables

int age = 20;
String name = "Faizan";
boolean isDeveloper = true;

Conditional Statements

if (age > 18) {
    System.out.println("Adult");
} else {
    System.out.println("Minor");
}

Loops

// For loop
for (int i = 0; i < 5; i++) {
    System.out.println(i);
}

// While loop int count = 0; while (count < 5) { System.out.println(count); count++; }

OOP Basics

Classes and Objects

public class Person {
    String name;
    int age;
    
    public void greet() {
        System.out.println("Hello, I'm " + name);
    }
}

// Creating an object Person p = new Person(); p.name = "Faizan"; p.greet();

Conclusion

Java is a great language to start your programming journey. Practice daily and build small projects!

footer.sh

© 2026 faizan@baig --all-rights-reserved

$ exit 0