What type of variables can be defined in an interface?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Studied at the University of Cambridge, Lives in Cambridge, UK.
In Java , interface doesn't allow you to declare any instance variables. Using a variable declared in an interface as an instance variable will return a compile time error. You can declare a constant variable, using static final which is different from an instance variable.Mar 12, 2010
2023-06-13 06:34:26
评论(499)
Helpful(122)
Helpful
Helpful(2)

Zoe Martin
QuesHub.com delivers expert answers and knowledge to you.
In Java , interface doesn't allow you to declare any instance variables. Using a variable declared in an interface as an instance variable will return a compile time error. You can declare a constant variable, using static final which is different from an instance variable.Mar 12, 2010