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
Can java list be null?
What is set in java?
Which method must be implemented by all threads?
what is the purpose of using rmisecuritymanager in rmi?
What is data type modifier?
Why is it called a string?
In how many ways we can create threads in java?
Which graphs are functions?
Why is method overloading not possible by changing the return type in java?
What are the principle concepts of oops?
What is nullpointerexception?
Explain some best practices you would apply while using collection in java?
What is arguments in java?
Can we create object of static class?
What is the use of http-tunneling in rmi?