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?

Related Posts:

Comments:

Blog Comments powered by Disqus.