Question: q1. What will the following code print out when it is run? public static double add(int a, double b) { return a + b +
q1.
What will the following code print out when it is run?
public static double add(int a, double b) { return a + b + 3; } public static double add(double a, int b) { return a + b + 1; } public static double add(int a, int b) { return a + b + 2; } public static void main(String[] args) { int a = 4; double b = 3.2; System.out.print(add(b, a)); } Group of answer choices
7.2
8.2
9.2
10.2
q2.
What will print out?
double num1 = 2.4; double num2 = 0.4; if ( num2 - num1 < 0.01) { System.out.println("close enough to equal"); } else { System.out.println("not close enough to equal"); } Group of answer choices
not close enough to equal
close enough to equal
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
