GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Quiz

AISE 2205

Jewella Macabenta 80 Fragen

Quiz starten

Fragen in diesem Quiz (80)

  1. 1A recursive call is always expensive in terms of memory usage
    1. ARichtig
    2. BFalsch
  2. 2A recursive call will always take more time to execute compared to an iterative call for the same problem
    1. ARichtig
    2. BFalsch
  3. 3If x is a reference-variable of a class called MyClass, and it is instantiated in the driver method, the following two statements in the driver method will execute the same result:

    System.out.println(x);
    System.out.println(x.toString());
    1. ARichtig
    2. BFalsch
  4. 4What are some reasons one would use an enhanced for-each loop instead of a for loop?

    1. If one wishes to access every element of an array
    2. If one wishes to modify elements of the array
    3. If one wishes to refer to elements through a variable name instead
    1. A1 and 3 only
    2. B2 and 3 only
    3. COnly 1
    4. DAll the options are correct
  5. 5What is the output of the following code segment?

    int[] numbers = {44, 33, 22, 11};
    for (int num : numbers) {
    num *= 2;
    }
    for (int num : numbers) {
    System.out.print(num + " ");
    }
    1. A88 66 44 22
    2. B46 35 24 13
    3. CNone of the choices are correct
    4. D44 33 22 11
  6. 6Given that 'array' is an array-reference of integers and 'target' is an integer value, which of the following best describes the conditions under which the following code segment will return true?

    boolean temp = false;
    for (int val : array) {
    temp = (target == val);
    }
    return temp;
    1. AWhenever the first element in array is equal to target
    2. BWhenever array contains any element which equals target
    3. Cwhenever only 1 element in array is equal to target
    4. DWhenever the last element in array is equal to target
  7. 7Which one of the following names follows the naming convention for a class name in Java?
    1. AmyFirstClass
    2. BMyFirstClass
    3. CMY_FIRST_CLASS
    4. Dmyfirstclass
  8. 8In the following Java statement, what does 'out' represent?

    System.out.println("Welcome to Java!");
    1. AA method
    2. BA PrintStream type reference-variable, which is a field in the System class
    3. CA class
    4. DA package
  9. 9How many class names do you see in the following code?

    public class MyClass {
    public static void main(String[] args) {
    System.out.println("The answer is: Yes");
    }
    }
    1. A1
    2. B2
    3. C3
    4. DNone of the choices are correct
  10. 10In Java, main() is a method name
    1. ARichtig
    2. BFalsch

Informationen

Beschreibung
bonus quizzes + review questions
Sprache
English
Aufrufe
15
Schlagwörter
engineering
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Mehr zu Java Arrays and Collections

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck