Skip to content

Basic Fundamentals Java Programming

petsereypanha/basic-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java Basic - Learning Project

A comprehensive Java learning repository covering fundamental to intermediate concepts with practical examples and exercises.

📚 Project Overview

This repository contains organized Java code examples and exercises for learning Java programming from basic concepts to object-oriented programming, GUI development, and collections.

🗂️ Project Structure

java-basic/
├── src/
│   ├── array/              # Array operations and exercises
│   ├── awt/                # AWT (Abstract Window Toolkit) examples
│   ├── basic/              # Basic Java syntax and operations
│   ├── collection/         # Java Collections Framework examples
│   ├── control_statement/  # If-else, switch-case, ternary operators
│   ├── form/               # GUI form examples
│   │   ├── AWT/           # AWT form implementations
│   │   ├── MarketForm/    # Market management forms
│   │   └── StaffForm/     # Staff management forms
│   ├── function/          # Function/method examples
│   ├── loop/              # Loop structures (for, while, do-while, enhanced for)
│   ├── oop/               # Object-Oriented Programming concepts
│   │   ├── basic/         # Classes, objects, constructors
│   │   ├── HashTable/     # HashTable implementations
│   │   ├── Inheritances/  # Inheritance examples
│   │   ├── Polymorphism/  # Polymorphism demonstrations
│   │   └── overide/       # Method overriding examples
│   ├── swing/             # Swing GUI components
│   └── test_mouse/        # GUI interaction examples
└── Main.java              # Entry point

📖 Topics Covered

1. Basic Concepts

  • Variables and data types
  • Operators (arithmetic, logical, relational)
  • Input/Output operations
  • Basic syntax and structure

2. Control Statements

  • If-else statements
  • Switch-case statements
  • Ternary operators
  • Conditional logic

3. Loops

  • For loops
  • While loops
  • Do-while loops
  • Enhanced for loops (for-each)
  • Nested loops

4. Arrays

  • One-dimensional arrays
  • Two-dimensional arrays
  • Array operations and manipulations
  • Array exercises

5. Functions/Methods

  • Method declaration and calling
  • Parameters and return types
  • Method overloading
  • Block functions
  • Date functions

6. Object-Oriented Programming (OOP)

  • Classes and Objects
  • Constructors
  • Encapsulation
  • Inheritance (Hierarchical, Multilevel, Multiple)
  • Polymorphism
  • Method Overriding

7. Collections Framework

  • HashTable
  • ArrayList
  • Vector
  • Collection operations

8. GUI Development

  • AWT (Abstract Window Toolkit)
  • Swing components
  • Event handling
  • Forms and layouts
  • Login forms
  • Data management interfaces

🚀 Getting Started

Prerequisites

  • Java Development Kit (JDK) 8 or higher
  • Any Java IDE (IntelliJ IDEA, Eclipse, NetBeans, or VS Code with Java extensions)

Running the Examples

  1. Clone or download the repository

    git clone https://github.com/petsereypanha/basic-java.git
    cd java-basic
  2. Compile a Java file

    javac src/basic/Firstprogram.java
  3. Run the compiled class

    java -cp src basic.Firstprogram
  4. Or use your IDE

    • Open the project in your IDE
    • Navigate to any Java file with a main method
    • Right-click and select "Run"

💡 Example Programs

Basic Arithmetic Operations

// Located in: src/basic/Firstprogram.java
// Demonstrates basic arithmetic operations

Student Grade System

// Located in: src/oop/basic/class_object.java
// Calculates student grades based on scores

Array Operations

// Located in: src/array/
// Various array manipulation examples

GUI Applications

// Located in: src/form/AWT/
// Login forms, person lists, and data management

📝 Key Features

  • ✅ Well-organized code structure
  • ✅ Practical exercises and examples
  • ✅ Progressive difficulty levels
  • ✅ Real-world application examples
  • ✅ GUI development samples
  • ✅ Comprehensive OOP demonstrations

🎯 Learning Path

  1. Start with src/basic/ - Learn fundamental Java syntax
  2. Move to src/control_statement/ - Understand program flow
  3. Practice with src/loop/ - Master iteration
  4. Explore src/array/ - Work with data structures
  5. Study src/function/ - Learn modular programming
  6. Deep dive into src/oop/ - Master object-oriented concepts
  7. Experiment with src/collection/ - Use Java collections
  8. Build GUIs with src/awt/, src/swing/, and src/form/ - Create user interfaces

🛠️ IDE Setup

IntelliJ IDEA

  1. Open IntelliJ IDEA
  2. Select "Open" and choose the java-basic folder
  3. Wait for the project to index
  4. Right-click any file with a main method and select "Run"

Visual Studio Code

  1. Install the "Extension Pack for Java" from the marketplace
  2. Open the java-basic folder
  3. Use the Run button or press F5 to execute files

📚 Additional Resources

🤝 Contributing

This is a personal learning project. Feel free to fork and create your own versions for learning purposes.

📄 License

This project is open source and available for educational purposes.

👤 Author

Serey Panha

📅 Last Updated

October 2025


Happy Coding! 🚀

Releases

No releases published

Packages

No packages published

Languages