Question: please explains the answer to all 3 ..l Wi-Fi Calling 13% O 10:29 PM moodle.purchase.edu P Flag question Select all the code snippets which contain

please explains the answer to all 3  please explains the answer to all 3 ..l Wi-Fi Calling 13%
O 10:29 PM moodle.purchase.edu P Flag question Select all the code snippets
which contain static methods. Select one or more: a. int power =

..l Wi-Fi Calling 13% O 10:29 PM moodle.purchase.edu P Flag question Select all the code snippets which contain static methods. Select one or more: a. int power = (int) Math.pow(2, 4); // is this static? b. Scanner sc = new Scanner(Syste m.in); int number = sc.nextInt(); // is this static? String[] names = new String [2] names [0] = "Athar"; names [1] = "Bob"; String allNames = Arrays.toStr ing(names); // is this static? ArrayList list = new ArrayList; list.add(7); // is this static X "add" is an instance method: it modifies a particular ArrayList object Your answer is incorrect. l Wi-Fi Calling 13% O 10:30 PM moodle.purchase.edu Select all the statements that invoke a constructor: Select one or more: ArrayList list = new ArrayList(20); // is a constructor invoked? b. int x = 35; // is a constructo r invoked? X An int is a primitive type, and primitive types do not have constructors. ArrayList list; // is a constructor invoked? X The new keyword was never used, so the constructor was not invoked. Scanner sc = new Scanner(Syste m.in); // is a constructor inv oked? Random r = new Random(); // is a constructor invoked? Your answer is incorrect . Wi-Fi Calling 13% O 10:30 PM moodle.purchase.edu Select all the code snippets containing instance methods: Select one or more: a. ArrayList list = getI nput FromUser(); Collections. sort(list); // is this an instance method? X The "sort" method is called using the name of a class (Collections), not the name of an object (list). ArrayList list = new ArrayList(); list.add(5); // is this an ins tance method? C. int number = 25; double root = Math.sqrt(number ); // is this an instance meth od? Random r = new Random(); int dieRoll = r.nextInt(6); // is this an instance method? Your answer is incorrect. The correct answers are

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!