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 are the uses of delegates in c#?
What is the file extension for c#?
Can extension methods access private members?
What is a clr (common language runtime)?
Can a static class contain non static members?
Can you prevent a class from being instantiated?
What do you understand by an Implicit Variable?
Explain how can you clean up objects holding resources from within the code?
what is the difference between convert.tostring() and tostring() functions ?
What is CLR and its application.?
What is polymorphism in c sharp?
What is predicate c#?
What are access modifiers used for?
How to get the sum of last 3 items in a list using lambda expressions?
What does readonly mean in c#?