This repository contains a collection of beginner-friendly Java programs for learning and practicing core Java concepts. Each file demonstrates a specific topic such as input handling, loops, conditionals, type casting, switch statements, and more.
com/ └── robin/ ├── AlphabetCheck.java ├── Calculator.java ├── EvenOdd.java ├── Inputs.java ├── LargestNumber.java ├── Loops.java ├── Name.java ├── PassingEg.java ├── SwitchStatement.java ├── Temperature.java ├── TypeCasting.java └── ... (other Java files)
- Clone the repository:
git clone https://github.com/your-username/Java-programs.git cd Java-programs
Compile a Java file: javac com/robin/Calculator.java Run a Java program: java com.robin.Calculator
Note: Make sure you have Java JDK installed and your JAVA_HOME and PATH are set up.
Programs Included Calculator.java: Simple calculator using switch-case and loops. AlphabetCheck.java: Checks if a character is uppercase, lowercase, or not an alphabet. EvenOdd.java: Checks if a number is even or odd. Inputs.java: Demonstrates taking integer input from the user. LargestNumber.java: Finds the largest of three numbers. Loops.java: Demonstrates for and while loops. Name.java: Takes a name as input and greets the user. PassingEg.java: Demonstrates passing arguments to methods. SwitchStatement.java: Example of switch-case with fruit names. Temperature.java: Converts Celsius to Fahrenheit. TypeCasting.java: Shows type casting in Java. Contributing Feel free to fork this repository and submit pull requests for improvements or new Java examples!
License This repository is licensed under the MIT License.
Replace your-username with your actual GitHub username in the clone URL.