knows a bit about java · Author has 90 answers and 325K answer views · 9y ·
Interface variables are made static and final because:
Static : as we can't have objects of interfaces so we should avoid using Object level member variables and should use class level variables i.e. static.
Final : so that we should not have ambiguous values for the variables(Diamond problem - Multiple Inheritance).
And as per the documentation interface is a contract and not an implementation.
5.5K views ·
View upvotes
· Answer requested by 1 of 6 answers
Something went wrong. Wait a moment and try again.