Beginner-friendly Java programs, starting from the basics.
HelloWorld.java— print a messageVariables.java— declare and display variablesUserInput.java— read input withScannerEvenOdd.java— check whether a number is even or oddAgeCheckForVote.java— check voting eligibility by ageMultiplicationTable.java— print a multiplication table using a methodPositiveNegativeZero.java— classify a number using conditionsCalculator.java— perform arithmetic on two user-entered numbersFahrenheitToCelsius.java— convert Fahrenheit to CelsiusStudentInfo.java— display student informationStudentGradeCalculator.java— calculate total, percentage, grade, and pass/fail resultClassAndObjectDemo.java— demonstrate a class and two objectsArrayAverage.java— calculate the average of numbers stored in an array
javac basic/HelloWorld.java
java -cp basic HelloWorldTo run the grade calculator:
javac basic/StudentGradeCalculator.java
java -cp basic StudentGradeCalculatorEach file contains one public class. The filename and class name must match.