GoConqr has a new look! Let us know what you think.

Quiz

Untitled

Athena Kozak 10 questions

Take the quiz

Questions in this quiz (10)

  1. 1Which one is not correct?
    1. AString shoes[] = new String[];
    2. Bint [] digits = new int[5];
    3. CPlant plantSpecies[] = new Plant[22];
    4. Ddouble weightClass[] = new double[2];
  2. 2You can remove 'memory slots' from an array if they are no longer needed.
    1. ATrue
    2. BFalse
  3. 3What will be the print out?

    char alphabet[] = new char[26];

    alphabet[0] = 'A';
    alphabet[1]= 'B';
    alphabet[2] = 'C';

    System.out.println(alphabet[1]);
    1. AA
    2. BB
    3. CC
    4. DNone of the above, it will print memory address
  4. 4When you create an Array, all elements inside must be the same data type.
    1. ATrue
    2. BFalse
  5. 5Choose the correct 'formula' for creating an array:
    1. Adata type + variable[] = new variable[n];
    2. Bdata type + [] + variable = new data type[n];
    3. Cvariable + data type[] = new data type[n]l
    4. Dvariable + [] + data type = new variable[n]
  6. 6This code will run:

    String names[] = new String[4];
    String[0] = "4";
    1. ATrue
    2. BFalse
  7. 7Loops are controlled by boolean statements.
    1. ATrue
    2. BFalse
  8. 8What is the correct way to calculate the length of the following array?

    String names[] = new String[5];
    1. Aint n = names.length();
    2. Bint n = getLengthOfNames[];
    3. Cint n = names.length
    4. Dint n = names.trim().length()
  9. 9What is the flaw in this line of code?

    int index= 0;
    while( index < words.length )
    {
    System.out.println(words[index]);
    }
    1. AThis is not the correct format to write a while loop
    2. BIndex is not incrementing so the loop is flawed
    3. CCondition is never true so it can not evaluate
    4. DThere is a synatx error
  10. 10What will print out?

    Movie movieTitle[] = new Movie[5];

    movieTitle[0] = "Nacho Libre";
    movieTitle[2] = "John Wick";
    movieTitle[3]= "Serenity';

    System.out.println(movieTitle[2]);
    1. Anull
    2. B"John Wick"
    3. CThe memory address for "John Wick"
    4. DSyntax Error

Information

Description
Quiz on Untitled, created by Athena Kozak on 15/03/2019.
Language
English
Views
2
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?