Results 1 to 5 of 5
  1. #1
    thelegendery is offline Member
    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Default private final class?

    Hello, please explain why someone would declare such an inner class?
    and especially why final if its a private class?

    Thanks

  2. #2
    Kagiso is offline Member
    Join Date
    Nov 2012
    Location
    Johannesburg, South Africa
    Posts
    92
    Rep Power
    0

    Default Re: private final class?

    From my understanding... An inner class is a member of the outer class just like methods and variables... so it can be declared private and final
    Why would you declare a method both private and final ?... If you answered my question ... then you've got your answer

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,728
    Blog Entries
    7
    Rep Power
    21

    Default Re: private final class?

    Possibly the programmer wants to protect the code from him/herself (i.e. extending the inner class in the outer class is not allowed if it is final).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: private final class?

    Crosspost: private final class
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    thelegendery is offline Member
    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

Similar Threads

  1. Retriving string from private static final class
    By KarlNorway in forum New To Java
    Replies: 9
    Last Post: 12-21-2011, 10:49 PM
  2. Replies: 2
    Last Post: 02-16-2011, 12:35 PM
  3. Why make class variables private?
    By PrinceSendai in forum New To Java
    Replies: 3
    Last Post: 10-18-2010, 12:01 PM
  4. Public, private or (nothing) class
    By tyang in forum New To Java
    Replies: 3
    Last Post: 02-01-2010, 12:37 AM
  5. [SOLVED] is final class members are also final ?
    By haoberoi in forum New To Java
    Replies: 4
    Last Post: 11-10-2008, 04:01 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
  •