Hero Image
- Mihai Surdeanu

(#3) Tricky Java Questions for Interviews

Motto: More stuff is coming...

Q1: Enumerate all advantages of immutable classes compared with mutable ones.

Q2: What’s printed to console when main method is called?

public static void main(String[] args) {
    Pattern myPattern = Pattern.compile("Dummy");
    System.out.println(myPattern.matcher("This is a dummy text").matches());

Can you please change method implementation for printing true, instead of false?

Q3: Enumerate all differences between a minor and a major garbage collection process. What happens during a full garbage collection process?

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