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 a two-dimensional array declared in C#?
What is a hash table c#?
write code for inserting and updating recoards in sql server database using connected architecture & records shoulds displayed in grid view ( use c# )
What is unrecognized escape sequence in c#?
Do we get an error while executing the “finally” block in c#?
Define a class and an object?
How does the lifecycle of Windows services differ from Standard EXE?
What does type safety mean?
What is hierarchical inheritance in c#?
What is a helper method in c#?
Will the following code compile?
What is difference between tostring() vs convert.tostring() vs (string) cast
What is difference between function and method in c#?
What is a private method in c#?
Why do we need collections in c#?