Study

PR1-W5-Part1-Switch, String Operations & Static  ...

  •   0%
  •  0     0     0

  • 18. In the context of overloading, which Java method is overloaded in the Math class? (5)
    D
  • 15. What is the key reason for using variables to hold intermediate values during incremental development? (4)
    B
  • 9. If no access specifier is provided for a method, where can it be called from? (5)
    B
  • 4. Which of the following modifiers is used to specify that a subroutine belongs to the class, rather than to instances of the class? (3)
    B
  • 19. What should be avoided when overloading methods in Java? (4)
    C
  • 14. What is the main benefit of incremental development? (3)
    C
  • 5. What is the role of the parameter-list in a method definition? (2)
    B
  • 12. What is the role of parentheses in a subroutine call, even if the subroutine has no parameters? (2)
    B
  • 8. In the method signature public static void main(String[] args), what does String[] args represent? (4)
    C
  • 11. What happens when you define a subroutine in a class? (2)
    B
  • 13. If you need to call a static method playGame() from a class named Poker, which of the following is the correct syntax? (3)
    B
  • 17. Why is the calculateArea() method not considered recursive? (4)
    B
  • 21. What does the expression !isSingleDigit(17) evaluate to? (3)
    A
  • 16. What should be done after the program is confirmed to be working during incremental development? (3)
    B
  • 10. Which of the following method signatures is invalid? (3)
    D
  • 7. Which of the following statements is false regarding parameters in a subroutine? (3)
    A
  • 22. Which of the following is a correct invocation of the isSingleDigit method? (2)
    B
  • 3. What happens if two methods in a class have the same name and the same parameter list? (4)
    A
  • 20. What does the second version of calculateArea method accept as parameters? (3)
    C
  • 2. By conventions, what is the correct way to define a method in Java? (2)
    C
  • Won 5 points
    5
  • Won 25 points
    25
  • 6. Consider the method declaration public void changeChannel(int channelNum). What does the int channelNum represent? (2)
    C
  • 1. What is a method in Java? (1)
    B