Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

K&B book mock test from CD

 
Prathima gaitonde
Ranch Hand
Posts: 130
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I just want to see am I right or not and at the same time, if I am right, then it may help others who have the same doubt.

I found this question in K&B mock test.

Which declare a compilable abstract class?

1> public abstract class xyz {public void m();}
2> public abstract class xyz {public void m(){}}
3> public class xyz {abstract public void m();}
4> public class xyz abstract {public abstract void m();}

I feel only option 2 is true.

According to the author both 1 and 2 are true.

Please correct me if I am wrong.

Kind regards,
Prathima
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only 2 is correct!

Bonus question: What's missing in option 1 to make it compilable?
 
Prathima gaitonde
Ranch Hand
Posts: 130
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:Only 2 is correct!

Bonus question: What's missing in option 1 to make it compilable?


abstract key word, as it is a class declaration not an interface, we have to add abstract keyword explicitly.

With respect,
Prathima
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perfect!

And what's the other change you could do to make option 1 compilable?
 
Prathima gaitonde
Ranch Hand
Posts: 130
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:Perfect!

And what's the other change you could do to make option 1 compilable?


Replace the semicolon with method body just like in option 2.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct!
 
Prathima gaitonde
Ranch Hand
Posts: 130
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I figured out that, there are so many questions that have got wrong answers marked in CD as right once!!! It not only misleads, but totally frustrating.
Is there any way I can report such errors? Author(s) in first few pages of the book have mentioned that, they visit this site oftenly, hence writing it here.

Is there any other site related to this book, where I can post my queries or doubts or errata (especially related to CD)?
Do they really care for our queries? if they do it would be good for other users of this book.

Regards,
Prathima
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prathima gaitonde wrote:Is there any way I can report such errors? Author(s) in first few pages of the book have mentioned that, they visit this site oftenly, hence writing it here.

Is there any other site related to this book, where I can post my queries or doubts or errata (especially related to CD)?

As far as I know there is no official resource (website, email) where you can post possible errata of this study guide (and/or its CD). But you can of course always start a topic here to share your doubts/questions. Be sure to provide a meaningful subject and provide exam number, unique question number (if available) and as much details as possible. So other users of the book will find the topic through google, no doubt!

Prathima gaitonde wrote:I figured out that, there are so many questions that have got wrong answers marked in CD as right once!!! It not only misleads, but totally frustrating.

I understand it can sometimes be frustrating to discover a mistake. But don't forget writing such a book is a very daunting task, one where a lot of people are involved. And people sometimes make mistakes, we are all humans and we all make mistakes. Additionally some of these people (e.g. content editors) don't know anything about Java. So when they see "public" at the beginning of a sentence, they might change it to "Public" (because first word in a sentence starts with a capital), not knowing it's correct in the English world but wrong in the Java world.

And to end with a positive note: if you are able to spot a mistake in the book and/or in the questions on the CD, it's a very good sign. You can only spot mistakes if you have a (very) good understanding of the concepts!

Hope it helps!
Kind regards,
Roel
 
Prathima gaitonde
Ranch Hand
Posts: 130
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel,

I fully understand the hardship involved in writing such a great book, I respect the authors effort. I just wanted to bring such mistakes to the authors notice, such that they can incorporate the required changes(if any), and thus, others can be benefited by that. Especially last few days of the preparation is very crucial and such mistakes can really mislead, It is not so much for my own good, I am trying to get it notified such that this book(CD) gets even better and helps its users even better way,

I am not talking about the wordings mistakes or missing parenthesis here, Its the mistake between code and right choice of answers, like one I have already mentioned in this thread, I will post even more (such doubts or wrong once) in few days, such that if its really wrong, authors can note it, and if not I can learn from it.

Thanks for your time, and help

With great respect,
Prathima
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prathima gaitonde wrote:Especially last few days of the preparation is very crucial and such mistakes can really mislead

True!

Prathima gaitonde wrote:I am not talking about the wordings mistakes or missing parenthesis here, Its the mistake between code and right choice of answers, like one I have already mentioned in this thread,

If a question lists the wrong correct answers, that's always a pity and can be frustrating as well. But I think with this particular question, it's not a really big issue. Because you can easily verify using the java compiler which answers are correct.

I had a look at my notes (I was a technical reviewer of this book) and there the correct answer (only B) is given. Then I searched for this particular question in the mock exam simulator itself and I think I found it: Q51 from OCA Exam 1. Is this the question you are refering to? Because if I look at the given explanation of this question, it states only B being the correct answer (A, C, and D being wrong for different reasons).

Kind regards,
Roel
 
Prathima gaitonde
Ranch Hand
Posts: 130
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel,

As ever you are right, I mistook the question and there by answers. I verified the question that I have mentioned in this thread, I was referring to the Exam1 Q51 itself. I was totally wrong in getting it and other 2 questions about which I was mentioning. My apologies to the authors and all java ranchers for misleading.

With respect,
Prathima
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prathima gaitonde wrote:As ever you are right, I mistook the question and there by answers. I verified the question that I have mentioned in this thread, I was referring to the Exam1 Q51 itself. I was totally wrong in getting it and other 2 questions about which I was mentioning. My apologies to the authors and all java ranchers for misleading.

No problem! Probably just caused by a mix of nerves for the upcoming exam and some mock exam blues after spending several hours of answering mock questions Everything is now cleared/resolved and no harm is done, so don't worry about it and enjoy your well-deserved certification.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic