Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. What does the following statement do? String[] widget; A. It declares an array of references to widget objects named String. B. It creates
1. What does the following statement do? String[] widget; A. It declares an array of references to widget objects named String. B. It creates a String object named widget. C. It creates an array of length zero named widget. D. It declares a variable widget which may in the future hold a reference to an array of references to String objects but is initialized to null, Say that names has been declared String[] names = new String[10]; and that further statements (not shown) have put String references into some of the cells. Which of the following fragments prints out the cells of the array from last to first, skipping cells that contain null? A. for (int j = 0; j = 0; j++) ( if (names[i] != null) System.out.println( names[j]); } > Java uses call by value. What is the value that is being passed into routine by the method call in the following? double] rats= (1.2, 3.4, 5.6); routine ( rats): A. A copy of the array rats. 3. Java uses call by value. What is the value that is being passed into routine by the method call in the following? double[] rats= (1.2, 3.4, 5.6); routine( rats): A. A copy of the array rats. B. The value of the elements of rats. C. A reference to the array object rats. D. 1.2 What does the following method do? public void spread (int[] values) for (int index=1: index < values.length; index++) values[index] = values[0]; } A. It changes an array by copying the element in cell 0 to all other cells. B. It changes an array by making every element the same as the value of its index. C. It changes an array by making every element zero. E It makes a change to the formal parameter but does not make a change to the caller's array. What does the following method do? public void blur (char[] z. String st) { if (z.length == st.length()) { for (int i=0; j
Step by Step Solution
★★★★★
3.43 Rating (162 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started