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

List primitive java types?

1096


What is the maximum size of byte array in java?

1076


Can a serialized object be transferred via network?

1025


What are the types of arrays in java?

1135


What is difference between classpath and path variables in java?

1260


What are different access specifiers in java? Explain

1188


Can you sort a string in java?

976


Explain about the interpreter in java?

1107


Is null in java?

1080


Which oo concept is achieved by using overloading and overriding?

1062


What are the types of methodology?

1154


What is difference between wait and notify in java?

1203


Explain about doubly linked list

1095


Why do we need hashset in java?

1099


What is the use of isempty in java?

1081