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


Please Help Members By Posting Answers For Below Questions

What is meant by desktop application?

496


Define c# and list the features.

527


What is a c# delegate?

601


What is difference between web and window application?

390


Why we use get and set method in c#?

494






Is list ienumerable c#?

599


What is difference between const and static in c#?

487


Explain About sn.exe

497


What is a .exe extension files? How is it similar to .dll extension files?

572


Explain the process of polymorphism with an example?

466


Are c# tuples immutable?

504


What is private void in c#?

518


What is typeof undefined?

502


How can I check the type of an object at runtime?

516


Can you put two constructor with the same structure in a class?

481