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
πŸ’¬ Discuss
βœ… Correct Answer: (B) double
Explanation: floating-point numbers are by default of type double.
Explanation by: Kiran Rapria
floating-point numbers are by default of type double.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
85
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Kiran Rapria
Publisher
πŸ“ˆ
99%
Success Rate