...

/

Practice Challenges for Fun

Practice Challenges for Fun

This lesson contains challenges that will let you practice what we learned in this chapter.

Quiz 1

Attempt the following quiz questions:

Technical Quiz
1.

Which of the following Java statements will declare and allocate an array capable of containing at most 20 integers?

A.
int[] numbers = new int[20];
B.
int[] numbers = new int(20);
C.
int[] numbers = new int[19];
D.
int[] numbers = new int(19);

1 / 4

Quiz 2

Attempt the following quiz questions:

1.

Write Java statements to display the contents of the array:

String[] daysOfWeek = {"Sunday", "Monday", "Tuesday", "Wednesday",
                       "Thursday", "Friday", "Saturday"};
Show Answer
Q1 / Q6
Press + to interact
Java
public class QuizAnswers
{
public static void main( String args[] )
{
String[] daysOfWeek = {"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"};
// Write your answer to Q1 here:
// Write your answer to Q2 here:
int[] numbers = {1, 3, 5, 7, 9};
// Write your answer to Q3 here:
} // End main
} // End QuizAnswers

Challenge

...