Skip to content
Quiz · Methods · lesson 6 of 8

Quiz — which method runs

What does the program print?

JAVA
public class Main {
    static void f(int x) { System.out.print("int"); }
    static void f(double x) { System.out.print("double"); }
    public static void main(String[] args) {
        f(5);
        f(5.0);
        f('a');
    }
}