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
+31
View File
@@ -0,0 +1,31 @@
=== Q21 == vs equals() on Strings ===
a == b -> true
a == c -> false
a.equals(c) -> true
=== Q22 Why is String immutable? ===
s = java
upper = JAVA
same object returned when nothing changes: true
=== Q23 String vs StringBuilder vs StringBuffer ===
builder result: cba-
append is synchronized: StringBuffer=true, StringBuilder=false
=== Q24 The string pool, compile-time constants and intern() ===
"hel" + "lo" == "hello" -> true
"hel" + lo == "hello" -> false
"hel" + finalLo == "hello" -> true
("hel" + lo).intern() == "hello" -> true
=== Q25 Reverse a string and check for a palindrome ===
weivretni
true
false
=== Q26 Useful String methods and the split() surprises ===
trim().length() = 6
strip().length() = 2
" ".isBlank() = true, "ab".repeat(3) = ababab
"a,b,,".split(",").length = 2
"a,b,,".split(",", -1).length = 4
String.join: 2026-11-11
=== Q27 Count characters, find the first non-repeating one, check anagrams ===
frequency: {s=3, w=1, i=1}
first non-repeating: w
listen/silent anagrams: true