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
What is meant by desktop application?
Define c# and list the features.
What is a c# delegate?
What is difference between web and window application?
Why we use get and set method in c#?
Is list ienumerable c#?
What is difference between const and static in c#?
Explain About sn.exe
What is a .exe extension files? How is it similar to .dll extension files?
Explain the process of polymorphism with an example?
Are c# tuples immutable?
What is private void in c#?
What is typeof undefined?
How can I check the type of an object at runtime?
Can you put two constructor with the same structure in a class?