LogiQuest
Back to Objects and Classes
14

What is the output of the following program?

public class Main {
    static int sq(int x) { return x * x; }
    static double sq(double x) { return x * x + 0.5; }
    public static void main(String[] args) {
        System.out.println(sq(3) + " " + sq(3.0));
    }
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.