Question
1. If there is an array named grades , what is the length of that array? a. grades.length() b. len(grades) c. grades.length d. grades.size 2.
1. If there is an array named grades, what is the length of that array?
a. grades.length()
b. len(grades)
c. grades.length
d. grades.size
2. String[] arr = {"a","t","e","c","b"};
What is the output when the program outputs elements at indexes 3, 4, and 1?
a. cbt
b. bet
c. tec
d. cat
3. Which statement below declares and initializes an array of movies?
a. String movies{};
b. String[] movies = {"Star Wars", "Inception", "The Matrix"};
c. String[] movies = ["Star Wars", "Inception", "The Matrix"];
d. String[] movies = [];
4. Every element in array my_arr is the value 1. A program passes my_arr to a method. The method changes every element of the array to 0. The method returns, and the main method outputs my_arr. What is the output?
a. Java Exception
b. All 1s
c. All 0s
d. No output
5. Consider an array with five elements 11, 22, 33, 44, and 55 in that order. Your program outputs the element at index 5. What is the output?
a. 5
b. 55
c. 1
d. Java exception
6. Which of the following is similar to the two-dimensional array concept?
a. Cups in a cupboard
b. an Excel spreadsheet
c. Birds on a fence
d. A line of people at a cash register
If there is an answer you dont know, you can leave it out, i need these asap. Thanks!!
Step by Step Solution
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