Mihai Surdeanu

(#6) Tricky Java Questions for Interviews

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?

One example of Spring banner

Mihai

Pasionat de IT. Pasionat de viață. Pasionat de tot ceea ce înseamnă a face o viață mai bună, plină de înțelegere, ajutor reciproc și iubire de aproape.

Adaugă comentariu

Arhive

Arhiva personală