Results 1 to 13 of 13
  1. #1
    amaliutz is offline Member
    Join Date
    Feb 2011
    Posts
    11
    Rep Power
    0

    Default couldnt find the answer..

    Which access level allows exclusive access to the attributes and methods that belong to a class or classes derived from that class?
    thx

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,571
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by amaliutz View Post
    Which access level allows exclusive access to the attributes and methods that belong to a class or classes derived from that class?
    thx
    Quiztime again? You abandoned your previous quiz and didn't give me my prize.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    amaliutz is offline Member
    Join Date
    Feb 2011
    Posts
    11
    Rep Power
    0

    Default

    i resolved all ..this one is left..
    so we have the answers..what u choose? :)
    default
    protected
    public
    private

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    Since you have narrowed it down the thing to do is actually construct a class with a method. Then make a subclass (or maybe two: one in the same package, one in a different package) which accesses that method.

    Finally try each of your four options as modifiers for the method declaration and see what the compiler says about each.

  5. #5
    amaliutz is offline Member
    Join Date
    Feb 2011
    Posts
    11
    Rep Power
    0

    Default

    and the answer is?

  6. #6
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,571
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by amaliutz View Post
    and the answer is?
    You try what Pbrockway2 suggested and see for yourself and please don't bother us anymore with those textbook questions.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    amaliutz is offline Member
    Join Date
    Feb 2011
    Posts
    11
    Rep Power
    0

    Default

    u are bothered too easy..:)

  8. #8
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    Wow! That seems like a case of the can't be bothered calling the nonbothered too easily bothered. Or something.

  9. #9
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by amaliutz View Post
    i resolved all ..this one is left..
    so we have the answers..what u choose? :)
    default
    protected
    public
    private
    default is for package level access, public is for world, private is for class access level. so what is leftover :)

  10. #10
    amaliutz is offline Member
    Join Date
    Feb 2011
    Posts
    11
    Rep Power
    0

    Default

    protected :) thank u very much

    and for the rest who are bothered..was easier to say "i dont know the answer"..right?
    u should try this..

  11. #11
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    it would have taken you approximately half a minute to find this answer with google. Next time you have a multiple choice question, try googling the choices first.

  12. #12
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,571
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by amaliutz View Post
    protected :) thank u very much

    and for the rest who are bothered..was easier to say "i dont know the answer"..right?
    u should try this..
    And you should do your own homework, little cheater.

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  13. #13
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,049
    Rep Power
    20

    Default

    Quote Originally Posted by amaliutz View Post
    protected :) thank u very much

    and for the rest who are bothered..was easier to say "i dont know the answer"..right?
    u should try this..
    The thing is we all know the answer...we're all (largely all anyway) beyond the point of tests on Java. You're the one doing the test, so you're the one who needs to put the effort in to it.

    Here's hoping I don't have to work with you anytime in the future...

Similar Threads

  1. Could anyway answer me this?
    By Jojomofoman in forum New To Java
    Replies: 14
    Last Post: 12-16-2010, 11:14 PM
  2. Please answer me quickly
    By sweet girl in forum New To Java
    Replies: 20
    Last Post: 12-10-2010, 10:17 PM
  3. Help me answer a few questions
    By namlunxxx in forum XML
    Replies: 3
    Last Post: 06-16-2010, 05:26 PM
  4. Replies: 3
    Last Post: 11-02-2008, 01:29 AM
  5. Plz answer this question ...
    By raghu2114 in forum Advanced Java
    Replies: 2
    Last Post: 09-19-2008, 06:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •