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

Which containers use a flowlayout as their default layout in java programming?

1017


What is the basic of java?

1032


How to access arraylist elements in java?

1002


I want to persist data of objects for later use. What is the best approach to do so?

1068


how do I create a runnable with inheritance? : Java thread

987


What is the generic class?

976


What is difference between == and === in js?

1016


What is difference between ++ I and I ++ in java?

986


How do you find the maximum number from an array without comparing and sorting?

1124


Why is the main method declared static?

1143


What is default locale java?

1126


Difference between keyword and identifier.

1042


What is natural ordering in java?

971


What is the length of a string?

1028


What is the importance of main method in Java?

1060