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
Give us the name of the list layoutmanagers in java?
What is application tier?
What is difference between fileinputstream and filereader in java?
Is integer a class?
explain the difference between jdk and jvm?
Does .length start 0 java?
What is mean by encoding?
Can you declare an interface method static?
What do you understand by access specifiers in Java?
Explain how can you debug the Java code?
How does predicate work in java?
Why pointers are not used in java?
Can we have multiple classes in single file ?
Are generics important java?
Why we use multi threading instead of multiprocessing?