SA
sam-francis06/Java-Learning
A repository to document my learning journey in Java, from basics to advanced concepts, with practice programs and projects.
Java Practice Programs
This repository contains my Java learning journey, organized into small programs and exercises. Each file focuses on a specific concept in Java, from the very basics to conditional statements, operators, and simple coding practice problems.
๐ Folder Structure
Java/
โ
โโโ day 1/
โ โโโ hello.java # Basic Hello World program
โ โโโ variable.java # Variable declaration & usage
โ โโโ userinput.java # Taking user input with Scanner
โ โโโ q1.java # Simple exercise
โ
โโโ day 2/
โ โโโ datatype.java # Working with Java data types
โ โโโ comparisonoperator.java # Comparison operators
โ โโโ logicaloperator.java # Logical operators (AND, OR, NOT)
โ โโโ checkwhether.java # Conditional check example
โ โโโ ifelse.java # If-Else statement
โ โโโ ifelsecompare.java # String comparison with equals()
โ โโโ Q1.java โ Q7.java # Small practice problems
โ โโโ stringcompare.java # String equality check
โ โ
โ โโโ coding practice/
โ โโโ Q1.java
โ โโโ Q2.java
โ โโโ Q3.java
โ
โโโ day 3/
โ โโโ elseif.java # If-Else-If ladder example
โ โโโ evenorodd.java # Check whether a number is even or odd
โ โโโ logicaloperator.java # Logical operators demonstration
โ โโโ nestedif.java # Nested if condition example
โ โโโ Q1.java # Small practice problem
โ โ
โ โโโ coding challenge/
โ โโโ Q1.java
โ โโโ Q2.java
โ โโโ Q3.java
โ
โโโ day 4/
โ โโโ ex1.java # Example 1 program
โ โโโ ex2.java # Example 2 program
โ โโโ forloop.java # For loop demonstration
โ โโโ ternaryoperator.java # Ternary operator usage
โ โ
โ โโโ coding challenge/
โ โโโ Q1.java
โ โโโ Q2.java
โ โโโ Q3.java
โ โโโ Q4.java
โ โโโ Q5.java
โ โโโ Q6.java
โ
โโโ day 5/
โ โโโ array.java # Basic array usage
โ โโโ example.java # Example program 1
โ โโโ example2.java # Example program 2
โ โโโ nestedforloop.java # Nested for loop demonstration
โ โโโ random.java # Random number generation
โ โโโ whileloop.java # While loop demonstration
โ โ
โ โโโ coding challenge/
โ โโโ Q1.java # Coding challenge problem 1
โ โโโ Q2.java # Coding challenge problem 2
โ โโโ Q3.java # Coding challenge problem 3
โ โโโ Q4.java # Coding challenge problem 4
โ
โโโ day 6/
โ โโโ classobject.java # Class & object basics
โ โโโ dowhileloop.java # Do-while loop demonstration
โ โโโ functions.java # Functions (methods) example
โ โโโ mobile.java # Class example (Mobile)
โ โโโ parameters.java # Functions with parameters
โ โ
โ โโโ coding challenges/
โ โโโ example1.java
โ โโโ example2.java
โ โโโ example3.java
โ โโโ example4.java
โ
โโโ (Compiled .class files are auto-generated after compilation)
๐ How to Run
-
Compile a Java file
javac filename.java
-
Run the compiled program
java filename
Example:
javac hello.java java hello
๐ Topics Covered
- Basics of Java (Hello World, Variables, Data Types)
- Taking User Input (
Scannerclass) - Operators (Arithmetic, Comparison, Logical)
- Control Flow (if, if-else, else-if ladder, nested conditions)
- String Comparison in Java
- Even/Odd Program
- Small Coding Practice Exercises (Q1โQ7)
- Coding Challenges (Day 3)
๐ Learning Purpose
This repository is mainly for:
- Practicing Java syntax and concepts.
- Preparing for coding interviews and exams.
- Building a strong foundation before moving to advanced topics like OOP, Collections, and Exception Handling.
๐ค Contribution
Feel free to fork this repository, add improvements, or share new practice problems!
๐ License
This project is licensed under the MIT License โ you are free to use, modify, and distribute.