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...

is it mandatory to deaclare all variables public static
fianl in interfaces?if i declare like in the below program,
public interface A
{
public static final int I=0;
int j=0;
}
in interface A,what is the difference between I,j?

Answer Posted / sreedhar a

As per interface definition all the member variables by
default are public static final. There is no difference
between I and j variables. JVM will consider the j variable
as public static final int j=0;
Note: variables declared in interface must be initialized
otherwise program will fail to compile.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When we serialize an object does the serialization mechanism saves its references too?

1005


Is void a wrapper class?

933


What is the function of static in java?

1052


What does snprintf return?

984


When does an object becomes eligible for garbage collection in java?

1045


How many types of array are there?

991


What is string and its types?

1161


Are arrays classes in java?

1016


Why java is called not pure object oriented language?

997


What is function and its uses?

1091


What is constructor and virtual function? Can we call a virtual function in a constructor?

1125


what is the constructor and how many types of constructors are used in java?

988


Explain polymorphism citing an example.

1026


What is flag in python?

1021


What does flag mean in java?

1003