Declaring Methods  «Prev 


Key Java Terms reviewed

Below are the correct associations. If you have any questions, enter your query into the search box listed above.
  1. What refers to the current object instance?

    Answer:
    this
  2. What is the declaration of several methods with the same name but uses different parameter lists?

    Answer:
    method overloading
  3. Which keyword indicates that a variable may not be serialized?

    Answer:
    transient
  4. Which access modifier allows a class to be accessed outside of its package?

    Answer:
    public
  5. Which keyword indicates that a variable or method applies to a class rather than to specific instances of the class?

    Answer:
    static
  6. Which level of access restricts access to the package in which an item is declared?

    Answer:
    package access
  7. Which level of access restricts access to the class in which an item is declared?

    Answer:
    private
  8. Which keyword is used to declare constants, prevent methods from being overridden, and prevent classes from being extended?

    Answer:
    final
    To stop a class from being extended, the class declaration must explicitly say it cannot be inherited.
    This is achieved by using the "final" keyword:
    public final class Account {
    
    } 
    
  9. Which access modifier restricts access to the class and subclasses in which an item is declared?

    Answer:
    protected
  10. What is the keyword used to describe declaring a method with the same name, parameter types, and return type as a method that is inherited from a superclass.

    Answer:
    overriding