Can we define a variable with the access modifier private
in an interface?
Answer Posted / hp
Yes we can declare variables in interafces
sample:
public interface nexusConstants {
// servlet names
public final String CSR_QUERY_SERVLET = "/qryCSS";
public final String MY_BILL_QUERY_SERVLET = "/qryMyBill";
public final String MY_HOME_QUERY_SERVLET = "/qryMyHome";
public final String TRY_BILL_QUERY_SERVLET = "/qryTryBill";
public final String CSR_XFER_SERVLET = "xferCSS"; }
This can be used by any class which require th values.
I have a live application which uses the interface variables.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How does substring work in c#?
What the different phase/steps of acquiring a proxy object in webservice?
What is the difference between readkey and readline in c#?
How to use delegates with events?
How can you use abstract class and interface?
What is the concept of strong names?
the c# keyword .int. Maps to which .net type?
What is the meaning of console writeline in c#?
What is the extension of c# file?
What is a hashset c#?
Is c# and c same?
Tell me the difference between value passing and address passing?
How to create multi-dimensional array?
What is c# windows form application?
What does writeline mean?