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 is difference between C# and VB.NET?
Explain the types of Polymorphism.
What are value types and reference types?
What are the boolean data types in c#?
Can c# inherit multiple classes?
Is learning c# hard?
Can abstract class instantiated c#?
What is strong data type in c#?
Int map to which .net types?
Where do we use serialization in c#?
What are types of constructor?
Why can't we use a static class instead of singleton?
What is an object pool in .net?
Explain the difference between and xml documentation tag?
What are the two kinds of properties in c#.