Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 The following code: int fib[][] = {{0, 1, 1}, {2, 3, 5, 8}, {13, 21, 34, 55, 89}}; System.out.print(fib[2][6]); displays 13 displays 8

QUESTION 1

  1. The following code:

    int fib[][] = {{0, 1, 1}, {2, 3, 5, 8}, {13, 21, 34, 55, 89}};

    System.out.print(fib[2][6]);

    displays 13

    displays 8

    displays an unknown value

    does not compile

    throws an Exception at runtime

QUESTION 2

  1. The following code:

    int progressions[][] = {{1, 4, 5}, {2, 5, 1}};

    progressions[1] = new int[]{1, 4, 6, 5};

    System.out.print(progressions[1][3]);

    displays 1

    displays 5

    displays an unknown value

    does not compile

    throws an Exception at runtime

QUESTION 3

What does the following code display?

int navigationalDeflector[] = {};

System.out.print(navigationalDeflector.length);

QUESTION 4

What does the following code display?

int tiny[] = new int[3];

try {

tiny[1] = 3;

tiny[2] = 2;

tiny[3] = 1;

System.out.print(tiny[1]);

} catch (ArrayIndexOutOfBoundsException ex) {

System.out.print("Exceptional");

}

QUESTION 5

  1. The following code:

    int vals[] = {1, 2, 3, 4};

    for(int val : vals) {

    System.out.print(val * val);

    }

    displays 1234

    displays 1*12*23*34*4

    displays 14916

    does not compile

    throws an Exception at runtime

QUESTION 6

  1. The following code declares and initializes an ArrayList collection variable that can only store Scanners (you may assume that ArrayList and Scanner have been properly imported)

    ArrayList tsaInventory = new ArrayList();

    True or False?

QUESTION 7

  1. The following code declares and initializes a one-dimensional array containing three elements

    int arr = [1, 2, 3];

    True or False?

QUESTION 8

  1. A 4-by-7 array like the following

    int arr[][] = new int[4][7];

    contains:

    4 rows and 7 columns

    7 rows and 4 columns

    3 rows and 6 columns

    6 rows and 3 columns

QUESTION 9

  1. This is a valid declaration and initialization of a 4-dimensional String array

    String inception[][][][] = {{{{"It's gonna get worse as we go deeper."}}}};

    True or False?

QUESTION 10

  1. What String does answer reference after this code executes?

    String multiPass[][] = {{"Leeloo", "Korbin"},{"Zorg", "Ruby"}};

    String answer = multiPass[1][0];

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books

Students also viewed these Databases questions

Question

Create hy being extemfllly open: How can I [aim find change?

Answered: 1 week ago