Question: Given the following code: Which import statements, when inserted independently at (1), will make the program print 7, when the program is compiled and run?

Given the following code:

// (1) INSERT ONE IMPORT STATEMENT HERE public class RQ700A20 { public

Which import statements, when inserted independently at (1), will make the program print 7, when the program is compiled and run? Select the two correct answers.

(a) import static Math.*;

(b) import static Math.sqrt;

(c) import static java.lang.Math.sqrt;

(d) import static java.lang.Math.sqrt();

(e) import static java.lang.Math.*;

// (1) INSERT ONE IMPORT STATEMENT HERE public class RQ700A20 { public static void main (String [] args) { System.out.println (sqrt (49)); } }

Step by Step Solution

3.51 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

c and e The name of the class must b... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!