Code hs 4.1.1 Java Arrays Quiz

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

When run, which of the following yields the integer 5?

int[] anotherArray = {5, 10, 15, 20, 25}; System.out.println(anotherArray[(anotherArray.length - 2)] - 15);

What is the output of the following program? public class SayHello { public static void main(String args[]) { String stringArray[] = {"h", "e", "l", "l", "o", "w"}; for(int i=0; i <= stringArray.length; i++) { System.out.print(stringArray[i]); } } }

Error

Which of the following are valid arrays? I. int[] coolArray = {1, 2, 3}; II. int[] threeThings = {1.0, 2.0, 3.0}; III. int[] = {"1", "2", "3"};

I only

Which of the following arrays has a length of 5?

None of the above

What values will the array contain after the following the code is run?

{1, -3, 3, -1, 5, 1, 7, 3, 9, 5, 11}


Ensembles d'études connexes

Chapter 18 applying heat and cold therapies

View Set

Part 1 (General) - Completing the Application, Underwriting and Delivering the Policy

View Set

Planet Protectors: What are the five basic types of Environmental pollution? nsf

View Set

Earth Science Earth/Mars Comparison

View Set

Menedzsment kvantitatív módszerei

View Set