A

Admin • 828.43K Points
Coach

Q. Determine output:
public class Test {
static void test(float x){
System.out.print("float");
}

static void test(double x){
System.out.print("double");
}

public static void main(String[] args){
test(99.9);
}
}

  • (A) float
  • (B) double
  • (C) Compilation Error
  • (D) Exception is thrown at runtime
  • Correct Answer - Option(B)
  • Views: 15
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
floating-point numbers are by default of type double.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.