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 many variables do you need?
What is ilist c#?
Can a class be protected in c#?
What is selector c#?
What is console read in c#?
What is the best dependency injection c#?
What method is used to sort the elements of the array in descending order?
What is generic method in c#?
What are destructors in C#?
What is private readonly in c#?
How do I know if executenonquery is successful c#?
Does c# have primitives?
What is difference between dynamic and var in c#?
Explain the difference between “constant” and “read-only” variables used in c#?
What is dll in vb.net?