• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

abstract private combination (Exam Lab)

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is a question in exam lab # 20 in practice test # 1
it says which statements are true, and it is not considering the answer " the combination of abstract ,private is not valid for inner classes" as a correct answer any one knows why?
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its a bit confusing but the rule is that an inner class can't have an abstract private method.

if exam lab is saying the contrary then its wrong.
 
hatem odeh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
even non inner classes they all should not have private abstract sa7 ?
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
of course. sorry for not mentioning that but I thought this was obvious.

bottom line: you can't have a method that is private & abstract nor a method that is final & abstract
 
hatem odeh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks man , i am reviewing a mock exam which i scored 42% (Exam Lab) but I found that all of my mistakes were silly I hope to avoid such mistakes in the real one. I think mock exams a lil bit distracts the information you got from the book is this true i feel that i should revisit the book before going to take the exam on saturday, and i should revisit all the mocks( the 4 exams of exam lab ) that i did is this procedure good ? do i have time ?
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well you have to choose accurate mock-exams where you find correct answers, I would suggest java inquisition and the mock questions of each chapter of the K&B book.

if you want to know about my own SCJP experience read my story

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

of course. sorry for not mentioning that but I thought this was obvious.
bottom line: you can't have a method that is private & abstract nor a method that is final & abstract


and static & abstract .
 
Ranch Hand
Posts: 537
Eclipse IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May be you should see the question properly. It may be choose all that are FALSE/ not true. So abstract private not valid for inner classes is false so the answer is correct. Even i did alot of mistakes in these types of questions.
 
Sheriff
Posts: 6959
1317
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please have a look at the question again. It does NOT ask you ONLY about methods/variables in the inner class. The question is about "inner classes", and thus the combination of abstract+private IS valid for inner class declaration.


That is why, "The combination "abstract private" is NOT valid for inner classes." is NOT considered as a correct option.

The question is correct.

Devaka.
 
Ranch Hand
Posts: 196
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hatem odeh wrote:there is a question in exam lab # 20 in practice test # 1
it says which statements are true, and it is not considering the answer " the combination of abstract ,private is not valid for inner classes" as a correct answer any one knows why?



The RULE is abstract things must be available for implementation atleast once.....
here for inner classes there is a possibility that we can implement it using another inner class in the same enclosing class....

This IS NOT POSSIBLE FOR METHODS
becasuse private methods are not known to anyone outside its class...........
 
karthick chinnathambi
Ranch Hand
Posts: 196
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nitish Bangera wrote:May be you should see the question properly. It may be choose all that are FALSE/ not true. So abstract private not valid for inner classes is false so the answer is correct. Even i did alot of mistakes in these types of questions.



no my friend....
The COMBINATION abstract-private IS LEGAL FOR INNER CLASSES......

you should try it yourself before posting.....
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic