All the variables of interface should be?

Kim Trang

New member
All the variables of interface should be?
A. default and final
B. default and static
C. public, static and final
D. protect, static and final
 
Answer: c
Explanation: Variables of an interface are public, static and final by default because the interfaces cannot be instantiated, final ensures the value assigned cannot be changed with the implementing class and public for it to be accessible by all the implementing classes.
 

Tìm kiếm

Back
Top