Skip to content

About

A comprehensive Java learning roadmap covering core syntax, OOP principles, Swing GUIs, and interactive CLI mini-projects.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Java Core & Fundamentals

My hands-on code examples and small side projects as I learned Java. Starts with simple terminal inputs and loops, then moves into OOP patterns, file streams, Swing GUIs, and audio playback.


📁 Code Layout

src/
├── Basics/          # Inputs, strings, math utilities, final keyword
├── arrays/          # Primitive arrays, 2D grids, ArrayLists
├── loops/           # For, while, nested, and enhanced loops
├── methods/         # Overloading and CLI calculator
├── oop/             # 13 packages covering OOP concepts
└── AdvancedJava/    # Audio player, file I/O, exceptions, Swing GUIs

📚 Core Concepts

1. Basics (src/Basics/)

  • UsersInput.java: Reading terminal input with Scanner.
  • StringMethods.java: Essential string operations like trim(), replace(), and length().
  • PrintfAndFinalKeyword.java: String formatting via printf and defining constants with final.
  • Factorial.java, MathTest.java, RandomNumber.java: Math calculations and random value generators.

2. Arrays & Collections (src/arrays/)

  • ArraysIntro.java & Arrays2DIntro.java: Fixed 1D arrays and 2D matrices.
  • ArrayList1.java & ArrayList2D.java: Dynamic lists that grow as elements are added.

3. Loops & Methods (src/loops/, src/methods/)

  • Loop mechanics: standard for, while, nested grid generation, and for-each iterations.
  • OverloadedMethods.java: Writing methods with shared names but different parameters.
  • MethodCalculator.java: Interactive command-line calculator using methods and switch statements.

4. OOP Concepts (src/oop/)

I split OOP into 13 standalone folders so each idea stays isolated:

Package Focus Key Concept
oop1intro Classes & Objects Creating blueprint classes (Car.java)
oop2Constructors Constructors Setting initial state with parameters
oop3Scope Variable Scope Field visibility: local vs. class-level
oop4Overloadedmethods Constructor Overloading Instantiating objects in multiple ways
oop5ToString toString() Overriding toString() for readable output
oop6ArraysOfObject Object Arrays Storing instances inside standard arrays
oop7ObjectPassing Passing Objects Sending object references into methods
oop8Inheritance Inheritance Parent (Superclass) and child (Subclass) setups
oop9SuperKeywordProject super Keyword Calling base class constructors and methods
oop10AbstractionProject Abstraction Abstract classes and interfaces (Crypto & Credit Card demo)
oop11AccessModifiers Access Control public, private, and protected scoping
oop12Encapsulation Encapsulation Protecting fields with getters and setters
oop13DynamicPolymorphism Polymorphism Overriding methods dynamically at runtime

🛠️ Mini Projects

  • Console Audio Player (src/AdvancedJava/AudioPlayer/)
    CLI player built on the Java Sound API (Clip, AudioSystem). Supports Play, Stop, Reset, and volume adjustments in decibels. I added volume boundary checks so hardware won't distort if out-of-range values are entered.
    Note: Expects a music.wav file in the root folder to play audio.

  • Safe Division & Exception Handling (src/AdvancedJava/ExceptionHandling/)
    Catches ArithmeticException (divide-by-zero) and InputMismatchException gracefully, using finally blocks to guarantee Scanner cleanup.

  • File Read & Write (src/AdvancedJava/FileHandling/)
    Reads and writes .txt files using FileReader, FileWriter, and try-with-resources for auto-closing file handles.

  • Swing Desktop Interfaces (src/AdvancedJava/GUI/)
    Desktop UI layouts (BorderLayout, GridLayout, LayeredPane) and controls like buttons, sliders, file choosers, and progress bars.


🚀 Quick Start

  1. Clone the repo:
    git clone https://github.com/Beratfkl/java-core-fundamentals.git
  2. Open in IntelliJ IDEA, Eclipse, or VS Code (JDK 17 or higher).
  3. Run any file with a main method (MethodCalculator.java, AudioPlayer/Main.java, etc.).

👨‍💻 Author

Written by Berat while working through core Java fundamentals and OOP principles.

About

A comprehensive Java learning roadmap covering core syntax, OOP principles, Swing GUIs, and interactive CLI mini-projects.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages