Add fresher-qa module: 50 Java interview questions for freshers, one runnable demo each, asserted transcripts, javac error captures

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b5DfjBGLBr7F5km2AN
This commit is contained in:
Claude
2026-11-11 19:48:45 +05:30
parent 22181e1a17
commit c5c435ae20
25 changed files with 1630 additions and 0 deletions
@@ -0,0 +1,8 @@
import java.nio.file.Files;
import java.nio.file.Path;
class CheckedNotHandled {
public static void main(String[] args) {
String s = Files.readString(Path.of("missing.txt"));
}
}
+7
View File
@@ -0,0 +1,7 @@
class Base {
final String locked() { return "Base.locked"; }
}
class Derived extends Base {
String locked() { return "Derived.locked"; }
}
+6
View File
@@ -0,0 +1,6 @@
class LossyCast {
public static void main(String[] args) {
int x = 3.5;
byte b = 200;
}
}
@@ -0,0 +1,5 @@
class MissingReturnAndUnreachable {
static int sign(int n) {
if (n > 0) return 1;
}
}
+10
View File
@@ -0,0 +1,10 @@
class Animal {
Animal() { }
}
class Puppy extends Animal {
Puppy(String name) {
if (name.isBlank()) throw new IllegalArgumentException("name required");
super();
}
}