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 you describe iuknown interface in short?
What is assembly and dll in c#?
What are assemblies?
What is the process of Serialization?
Can we have only “try” block without “catch” block in c#?
What is difference between Enum and Struct?
Can hashtable have duplicate keys?
What is marshalling and what are different kinds of marshalling?
What is the difference between int and int in c#?
What is the example of predicate?
Is c# strongly typed?
What is a type c#?
What is difference between ienumerable and iqueryable in c#?
What are the different approaches of passing parameters to a method?
Explain the role of Garbage collector and its generations?