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

Quiz

AISE 2205

Jewella Macabenta 80 questions

Take the quiz

Questions in this quiz (80)

  1. 1A recursive call is always expensive in terms of memory usage
    1. ATrue
    2. BFalse
  2. 2A recursive call will always take more time to execute compared to an iterative call for the same problem
    1. ATrue
    2. BFalse
  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. ATrue
    2. BFalse
  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. ATrue
    2. BFalse

Information

Description
bonus quizzes + review questions
Language
English
Views
15
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?