Skip to main content
PreparationZone Logo
PrepZone

Pack 2: Overloading & Control Flow

Ten puzzles on overload resolution, loops, switch fall-through, catch order, and varargs.

Pass checkpoint below

Pack 2 — overloading & control flow

Overloading & control flow

Resolution rules, loops, switch, and exception paths.

0/10 solved
  1. What is printed?

    Java
    public class Main {
        void print(Integer i) { System.out.print("I"); }
        void print(int i) { System.out.print("i"); }
        void print(long i) { System.out.print("l"); }
    
        public static void main(String[] args) {
            new Main().print(null);
        }
    }
    Predict the output, then tap Run on the code block

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Test yourself

Answer these before moving on — recall is what makes it stick.