Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 difference between C# and VB.NET?

1156


Explain the types of Polymorphism.

1139


What are value types and reference types?

1139


What are the boolean data types in c#?

1019


Can c# inherit multiple classes?

958


Is learning c# hard?

924


Can abstract class instantiated c#?

902


What is strong data type in c#?

885


Int map to which .net types?

1026


Where do we use serialization in c#?

904


What are types of constructor?

892


Why can't we use a static class instead of singleton?

880


What is an object pool in .net?

1054


Explain the difference between and xml documentation tag?

911


What are the two kinds of properties in c#.

948