Files

fresher-qa

Runnable companion for the ankurm.com article Top 50 Java Interview Questions for Freshers (2026) with Simple Answers.

One small demo per question, grouped in six classes. Tests assert what each demo prints and write the transcripts the article quotes. There is no docs/ folder on purpose: the explanations live in the article.

Component Version Verified against
JDK 25.0.5+8 (Temurin, LTS) java -version
JUnit 6.1.3 maven-metadata.xml on Maven Central
Maven 3.9.11 mvn -version
export JAVA_HOME=/path/to/jdk-25 && export PATH="$JAVA_HOME/bin:$PATH"
cd fresher-qa
mvn test                  # 6 tests; rewrites output/01-06
./scripts/run-all.sh      # also regenerates output/07 (javac's own error messages for src/broken/)
Class Questions Transcript
BasicsQa 1-9 output/01-basics.txt
OopQa 10-20 output/02-oop.txt
StringsQa 21-27 output/03-strings.txt
CollectionsQa 28-38 output/04-collections.txt
ExceptionsQa 39-43 output/05-exceptions.txt
ModernJavaQa 44-50 output/06-modern-java.txt

src/broken/ holds five files that must NOT compile (one of them only fails below Java 25); scripts/compile-errors.sh runs javac on each and commits the real message to output/07-compile-errors.txt. They are excluded from the Maven build.