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

what do you mean by java annotations?

1061


Is a method a procedure?

999


What is sorting in java?

942


Is integer immutable in java?

938


What is the functionality of the stub?

984


How can we create a synchronized collection from given collection?

1048


What are advantages of using Java?s layout managers than windowing systems?

2322


What are the two environment variables that must be set in order to run any java programs?

914


How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?

962


What does indexof return in java?

945


Why java is object oriented?

970


Is integer passed by reference in java?

982


What are the types of sockets in java?

1068


What is difference between checked and unchecked exception in java?

967


What is an infinite loop in java? Explain with an example.

985