This repository contains three beginner-friendly Java exercises built around the following topics:
- Introduction to Java + Installing Java JDK and IntelliJ IDEA for Java
- Basic Structure of a Java Program: Understanding our First Java Hello World Program
- Variables and Data Types in Java Programming
- Literals in Java
- Getting User Input in Java
- Operators, Types of Operators & Expressions in Java
- Associativity of Operators in Java
- Data Type of Expressions & Increment/Decrement Operators
- q1: A fill-in-the-blanks exercise focusing on basic program structure, variables, data types, and simple output.
- q2: A complete program exercise that practices user input, operators, expressions, and basic calculations.
- q3: A program demonstrating literals, increment/decrement operators, data type conversions, and operator associativity.
Each question lives in its own folder (q1/
, q2/
, q3/
) and contains:
qX.java
— the source file (either a template with "// FILL HERE" comments or a blank starter file).README.md
— clear instructions, expected input/output, and what to fill/implement.
Using Command Prompt or PowerShell:
# compile
javac q1/q1.java
javac q2/q2.java
javac q3/q3.java
# run
java -cp q1 q1
java -cp q2 q2
java -cp q3 q3
Alternative method (from each question's directory):
# For q1
cd q1
javac q1.java
java q1
# For q2
cd q2
javac q2.java
java q2
# For q3
cd q3
javac q3.java
java q3
- Edit the
q1/q1.java
,q2/q2.java
, andq3/q3.java
files to implement the solutions requested in their READMEs. - Commit and push your changes to YOUR FORKED REPOSITORY.
- Correctness: Output must match the expected sample output in each question's README.
- Readability: Use meaningful variable names and proper Java naming conventions.
- Demonstration of concepts: Show that you understand:
- Basic Java program structure
- Variables and data types
- Literals and their usage
- User input with Scanner
- Operators and expressions
- Increment/decrement operations
- Data type conversions
- Java JDK 8 or higher installed
- Basic understanding of command line/terminal usage
- Text editor (VSCode Recommended) or IDE (IntelliJ IDEA recommended)
Proceed to the q1/
, q2/
, and q3/
folders and complete the exercises in order.