Declarations and Access Control Self Test Flashcards
Can variables names begin with #
No
Can variable names begin with a currency sign ($ £ €)
Yes
If variable in public class in other package is declared protected, how can it be accessed?
Can only be accessed through inheritance ie through extending class and using variable ref, not through class instantiation ref
What are interface methods by default? (Private, default, private, protected)
Public
What must classes which implement interface methods implement them as?
Public
Can visibility be reduced for implemented methods from interfaces?
No, visibility cannot be reduced.
Does an interface extend or implement another interface?
Interfaces extend other interfaces
Can a non-static method in another class be invoked from a static context?
No, it cannot be invoked.
Method must be declared static.