Originally posted by Vikramaditya Bindal:
Hi all,
I am not sure if I am actually allowed to post the question directly from the K&B book here for public viewing. So at this stage, just going to mention, two questions which I had.
Chapter 2, SELF - TESTS, Question 3
Correct Answer accd to the book: A, C, E
I choosed A, E and F
My reason for selecting F:
Option F states that "If class A was not abstract and method m1( ) on line 2 was implemented, the code would not compile".
If one examines the code snippet given, Then accd to the theory, If a class has a method abstract, then the class should be declared abstract, ELSE ERRORS !!!.
Though, even option C looked right to me, but the question said PICK Only three.
Am I CORRECT OR WRONG, if wrong, then can someone please explain me WHY ? thanks :-)
Chapter 2, SELF - TESTS, Question 14
I selected C and F, the book says B and F.
My Reason: I know the "run" method to be used for whenever the Runnable interface is implemented ( "public void run( )" ).. How can ONE FORGET, K&B highlighted this in a very "ATTRACTING MANNER" :-).
But the way the options for the questions were put, It appeared to me, that they were very much precise to as if just run() method or public void run().
I just wanted to ensure, when one see's a question like this, which is the way to go ??
Those were the two questions I had..
Help would be appreciated.
Oh and K&B, I wish you could also write some of the electrical engineering books.
I am sure.. I know lot of guys who would have been thankfull to u, including me.. :-)
Your BOOK ROCKSSSSSSSSSSSSS
For Question #3,
I think the authors are saying that if the method m1() on line 2 was implemented that it infers that the abstract modifier would be removed as well. Thus, the code WOULD compile. Therefore, answer f is false and does not meet the criteria.
For Question #14,
I interpreted answer C as saying you can ONLY have a run method that is empty. Obviously, you can put any code you wish into the run method (within reason).
I do agree with you though, the K&B book is excellent. I have read three other
Java certifiation books and none came close to the level of detail and ease of reading that this book gives the reader.