What value of i is printed after two post-increments?
int i = 5; int s = i++ + i++; System.out.println(i);Read the full question →Java runs a very large share of enterprise back ends. Its interviews reward knowing the memory model as well as the syntax.
Collections behaviour, equals and hashCode contracts, string interning, checked versus unchecked exceptions, stream laziness, and the concurrency primitives.
Where it shows up: Banking, large-scale services, Android, and any company running Spring in production.
Twenty real Java questions from the library, code snippet included. Nothing here is paraphrased for search engines. It is the same text a signed-in user sees.
int i = 5; int s = i++ + i++; System.out.println(i);Read the full question →List<String> r = Stream.of("A","B","C").map(String::toLowerCase).toList();Read the full question →record Point(int x, int y) {}
static String format(Object o) {
return switch (o) {
case Point(int x, int y) -> "x+y=" + (x + y);
default -> "?";
};
}Read the full question →int x = 5;\nx = x++;\nSystem.out.println(x);Read the full question →List<Supplier<Integer>> ss = new ArrayList<>();\nfor (int i = 0; i < 3; i++) { ss.add(() -> i); }Read the full question →String a = new String("x");\nString b = new String("x");\nSystem.out.println(a.equals(b));Read the full question →int x;\nif (false) x = 5;\nSystem.out.println(x);Read the full question →CompletableFuture<Integer> f = CompletableFuture.completedFuture(5);\nSystem.out.println(f.get());Read the full question →int[] a = new int[0];\nSystem.out.println(a.length);Read the full question →System.out.println(List.of(1, 2));Read the full question →class A { static String f() { return "A"; } }\nclass B extends A { static String f() { return "B"; } }\nA a = new B();\nSystem.out.println(a.f());Read the full question →long c = Stream.of("a","b","c").filter(s -> s.equals("b")).count();\nSystem.out.println(c);Read the full question →List<Integer> list = new ArrayList<>(List.of(1,2,3,4));\nIterator<Integer> it = list.iterator();\nwhile (it.hasNext()) { if (it.next() % 2 != 0) it.remove(); }\nSystem.out.println(list);Read the full question →static int f() {\n try { return 1; } finally { return 2; }\n}\nSystem.out.println(f());Read the full question →interface I1 { default int f() { return 1; } }\ninterface I2 { default int f() { return 2; } }\nclass C implements I1, I2 {}\nnew C().f();Read the full question →List<String> list = List.of("b","a");\nlist.sort(null);Read the full question →System.out.println(Stream.of(1,2,3).filter(i -> i<2).findFirst().orElse(0));Read the full question →class A { static String f() { return "A"; } }\nclass B extends A { static String f() { return "B"; } }\nA a = new B();\nSystem.out.println(a.f());Read the full question →static int f(int n) { return f(n - 1); }\nf(5);Read the full question →System.out.println(IntStream.range(0,3).reduce(0, Integer::sum));Read the full question →We keep the correct answer, the explanation and the scoring behind sign-in so the platform stays honest, which is why the answer options and the worked explanation for every Java question stay behind a free account. Signing in is free and takes a few seconds.
44 distinct Java topics are tagged across the library. These are the real topic labels stored on the questions, not a hand-written list.
…