click below
click below
Normal Size Small Size show me how
cs124
| Question | Answer |
|---|---|
| What statement is used to specify the value that a method gives back to its caller? | return |
| Which of the following declares a sideLength instance variable for a Square class that stores an integer value? | private int sideLength; |
| What is the process of hiding object data and providing methods for data access called? | encapsulation |
| A method header consists of which of the following parts? | an access specifier, a return type, a method name, and a list of the parameters (if any) |
| Which of the following corresponds to a valid constructor header for the Player class? | public Player() |
| Which of the following is a valid constructor header for the Player class that accepts the player name as a parameter? | public Player(String playerName) |
| Which of the following corresponds to the constructor header for a Square class that accepts an initial side length as an integer value? | public Square(int initialLength) |
| Which of the following corresponds to the getArea method header for a Square class assuming an integer value for a side length? | public int getArea() |
| Which line of code is part of the private implementation of the BankAccount class? | balance = balance - amount; |
| Which line of code is part of the public implementation of the BankAccount class? | public BankAccount(double initialBalance) |