Hero Image
- Mihai Surdeanu

(#6) Tricky Java Questions for Interviews

Motto: Introduce first Spring framework question!

Q1: In which Java version, text blocks are available as preview feature?

  1. Java 10
  2. Java 11
  3. Java 12
  4. Java 13

Q2: What's the output printed to console if you are using Java 11?

public static void main(String[] args) {
    Map<String, String> myMap = Map.of("key", "value");
    Map<String, String> myCopyMap = Map.copyOf(myMap);

    System.out.println(myCopyMap == myMap);
}

Q3: Spring Framework question. If you already worked with Spring framework, you probably already observed that a banner is printed to console when a Spring app is starting (during bootstrap phase). Can you imagine some useful situations when printing this banner is actually helpful?

Other Related Posts:

Microbenchmarking with Java

Microbenchmarking with Java

Hello guys,

Today, we are going to continue the series of articles about Java ecosystem. More specific, today, we are going to talk about JMH (Java Microbenchmark Harness).

2nd Apr 2022 - Mihai Surdeanu