Results 1 to 5 of 5

Thread: Abstract class

  1. #1
    naeem.jamil is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Default Abstract class

    Can any one please explain and tell me reason. Why abstract class can not have static and final fields?

  2. #2
    thusa is offline Member
    Join Date
    Jul 2008
    Posts
    19
    Rep Power
    0

    Default

    Who told you that abstract classes can not have static final fields?

    Have you tried?

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by naeem.jamil View Post
    Can any one please explain and tell me reason. Why abstract class can not have static and final fields?
    From where you did get this. It's possible. Did you try with any example?

  4. #4
    naeem.jamil is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Default Abstract Class

    Quote Originally Posted by thusa View Post
    Who told you that abstract classes can not have static final fields?

    Have you tried?
    Thanks, I have read that statements again. It was mentioned "abstract classes can contain fields that are not static and final" it means it can contain static and final as well as which are not. I was studing from the following pages.
    java.sun.com/docs/books/tutorial/java/IandI/abstract.html

    Abstract Methods and Classes (The Java™ Tutorials > Learning the Java Language > Interfaces and Inheritance)[/url]

    Thanks and send ur more comments if possible.

  5. #5
    thusa is offline Member
    Join Date
    Jul 2008
    Posts
    19
    Rep Power
    0

Similar Threads

  1. Can this be done using abstract class??
    By romina in forum New To Java
    Replies: 6
    Last Post: 03-02-2009, 01:46 PM
  2. Interface Vs Abstract Class
    By javarishi in forum New To Java
    Replies: 5
    Last Post: 06-15-2008, 06:43 AM
  3. abstract sub-class
    By feniger in forum New To Java
    Replies: 6
    Last Post: 05-21-2008, 08:10 AM
  4. Replies: 0
    Last Post: 04-02-2008, 08:04 AM
  5. Abstract Class
    By gapper in forum New To Java
    Replies: 4
    Last Post: 01-31-2008, 02: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
  •