Results 1 to 6 of 6
  1. #1
    $hr!k@nt is offline Member
    Join Date
    Dec 2007
    Posts
    4
    Rep Power
    0

    Question Final,abstract and static

    Why cant constructor be marked as Final????

    and also

    Why cant static and abstract go together???

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    Quote Originally Posted by $hr!k@nt View Post
    ...
    Why cant static and abstract go together???
    This, coming from the source - Sun itself.

  3. #3
    spoon! is offline Member
    Join Date
    Dec 2007
    Posts
    12
    Rep Power
    0

    Default

    final means method cannot be overridden; constructors can't be overridden

    abstract means method must be overridden; static methods can't be overridden

  4. #4
    $hr!k@nt is offline Member
    Join Date
    Dec 2007
    Posts
    4
    Rep Power
    0

    Unhappy Still confused!!!!!!

    I still dont get why constructor cant be declared as final????

  5. #5
    jelly's Avatar
    jelly is offline Member
    Join Date
    Jan 2008
    Location
    Somerset, UK
    Posts
    46
    Rep Power
    0

    Default

    You can't mark constructors as final as there would be no meaning, as spoon says constructors cannot be overridden, final only makes sense when applied to something that _could_ have been overridden but you don't want it to be.
    -- Hope that helps

  6. #6
    $hr!k@nt is offline Member
    Join Date
    Dec 2007
    Posts
    4
    Rep Power
    0

Similar Threads

  1. Abstract Class with Static Methods
    By bugger in forum New To Java
    Replies: 7
    Last Post: 09-05-2008, 12:20 AM
  2. Replies: 1
    Last Post: 08-07-2007, 05:05 AM
  3. Replies: 1
    Last Post: 08-01-2007, 09:25 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
  •