What does the following generics code fail to compile? “`java List ints = new ArrayList(); List nums = ints; // Compile error? “` Java ProfessionalHard Try Now
What is a `ForkJoinPool` and how does work-stealing improve throughput? Java ProfessionalHard Try Now
What is the purpose of sealed interfaces combined with pattern matching in switch (Java 21)? Java ProfessionalHard Try Now
What is the happens-before guarantee provided by `synchronized` blocks? Java ProfessionalHard Try Now
What is the result of this code? “`java String s1 = new String(“hello”); String s2 = s1.intern(); String s3 = “hello”; System.out.println(s1 == s2); System.out.println(s2 == s3); “` Java ProfessionalHard Try Now
What is escape analysis in the JVM and what optimization does it enable? Java ProfessionalHard Try Now
What is the output of the following code? “`java int i = 0; while (i++ < 3) { if (i == 2) continue; System.out.print(i + " "); } “` Java ProfessionalHard Try Now
What is the difference between `ZGC` and `Shenandoah` garbage collectors? Java ProfessionalHard Try Now
What is the ABA problem in compare-and-swap (CAS) operations and how does `AtomicStampedReference` solve it? Java ProfessionalHard Try Now
What does the following code produce? “`java List list = Arrays.asList(“a”, “b”, “c”); list.stream() .filter(s -> s.equals(“b”)) .findFirst() .ifPresent(System.out::println); “` Java ProfessionalHard Try Now
What is the difference between `PermGen` (Java 7) and `Metaspace` (Java 8+)? Java ProfessionalHard Try Now
What is the consequence of violating the `Comparable.compareTo()` contract regarding consistency with `equals()`? Java ProfessionalHard Try Now
What is `invokedynamic` bytecode instruction and how does it enable lambda expressions? Java ProfessionalHard Try Now