static member variables in interface

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #1

    static member variables in interface

    i have a little bit confusion on interface and static members variables in it.
    having static member variables in interface and non-static member variables...... .....what is the difference?

    plz help.

    regards.
  • sateesht
    New Member
    • Apr 2007
    • 41

    #2
    Originally posted by dmjpro
    i have a little bit confusion on interface and static members variables in it.
    having static member variables in interface and non-static member variables...... .....what is the difference?

    plz help.

    regards.
    In Interface while declaring the variables, if you are not mentioned static,
    by default it will be treated as static variable, you are unable to declare the non-static variables in Interface, not only that if you declare a variable in Interface by not mentioning the static or non-static it will be treated as public static final which means a Constant, reason being we are unable to create an Object for an Interface, so to use the Variables of an Interface , the variables must be Static

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      fantastic .... it was in my mind

      i just waiting for a perfect answer.

      anyway thanx.

      Comment

      Working...