Question: Unit 6-Array Name: HW 4 - For Each Loop and Arrays of Objects 1) Consider the following code segment. int [] nums ={10,5,8,13}; for (int

Unit 6-Array Name: HW 4 - For Each Loop and Arrays of Objects 1) Consider the following code segment. int [] nums ={10,5,8,13}; for (int i: nums) \{ \} What is printed when this code segment is run? 2) Consider the following method, which is intended to print the first letter of every String in the array words. Fill in the blank that will allow this segment of code to do that. public static void printinitials (String[] words) f for (String s : words) \{ System.out.println( \} 3) Consider the following code segment. int [] arr ={3,5,8,10}; for (int n: arr) f n=2; System.out.println(arr[2]); What is printed when this code segment is run? 4) Consider the following method, which is intended to return the largest value in an array of int. Fill in the blanks that will allow the segment of code to do that
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
