This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Murach's Java Programming and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java OCA 8 Chapter 5 - Class Design - Review Questions Ex 19  RSS feed

 
C Muntean
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am currently as exercise 19 from Chapter 5:

Which of the following statements can be inserted in the blank so that the code will compile successfully? (choose all that apply)

public class Snake{}
public class Cobra extends Snake{}
public class GardenSnake {}
public class SnakeHandler {
    private Snake snake;
    public void setSnake(Snake snake) {
               this.snake = snake;
    }

    public static void main(String args[]) {
               new SnakeHandler().setSnake();
    }
}

I have the Kindle editio of the book and I am reading it using the Kindle Cloud Reader.

I cannot seem to see the blank that the exercise refers to. Could you please tell me where is it? (which line?)
Is it before the expression "new SnakeHandler().setSnake();" ?

Thanks


 
C Muntean
Greenhorn
Posts: 6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have found the answer here:
Chapter5 Review Question #19 (Java OCA 8 Programmer I Study Guide, Sybex)

new SnakeHandler().setSnake(________________);

The correct answers are now clear: A, C, F

Thanks
 
Knute Snortum
Sheriff
Posts: 3834
91
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting the answer you found.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!