Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

interface member variable

i would like to know about interface member variables. I was reading as

Interfaces may have member variables, but these are implicitly public, static, and final- in other words, interfaces can declare only constants, not instance variables that are available to all implementations and may be used as key references for method arguments for example.



i am not clear on what it mean by ' as key references for method arguments'. Thanks in advance
0
gudii9
Asked:
gudii9
1 Solution
 
for_yanCommented:
Think about some say SwingConstants interface or something like that when they have constants like ScrollbarPoloicy.ALWAYS_PRESENT or something like that. The set methid actually need sinmpole integer, but for you easierbto remememver this integrer is given such mname and tyou use it is setrPoloicy method. You'll nmever need to change integer - so it isa final , it is all rthe way constant for all instances, and it is desugned to be used as parameter of tge methods.
0
 
rumi78Commented:
gudii9 what a book you are reading ... :)

'as key references for method arguments' may be understand as 'may be used' :)
the example was about:
method(Interface.CONSTANT);
0
 
Kevin CrossChief Technology OfficerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now