Solved

interface member variable

Posted on 2011-09-07
4
220 Views
Last Modified: 2012-05-12
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
Comment
Question by:gudii9
4 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 36495604
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
 
LVL 7

Expert Comment

by:rumi78
ID: 36498385
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
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 36935269
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
servlet  URL Rewriting 1 42
fibonacci ten numbers 4 45
type mismatch (Object[] to double[] 4 33
difference between sorce folder and folder in eclipise 3 29
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question