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
Can a constructor be static in c#?
What is args c#?
What are abstract classes in c#?
What does async mean in c#?
What is enum in c#?
What is a property c#?
Can arraylist hold primitive types?
What is method and function in c#?
Do unused Namespaces in c# affect run-time performance?
Why do I get a security exception when I try to run my c# app?
Name some string escape sequences in c#.
Why do we need static class in c#?
What is a method signature in c#?
What is the difference between abstraction and encapsulation in c#?
What is the use of return in c#?