What are access levels for classes and interfaces?

What are access levels for classes and interfaces?

Situationpublicprotecteddefaultprivate
Accessible to class from same package?yesyesyesno
Accessible to class from different package?yesno, unless it is a subclassnono
What is the List interface?
What is the List interface? - The List interface provides an ordered collection. Elements in the List can be accessed using integer indexes...
What is an Iterator interface?
What is an Iterator interface? - An iterator acts over a collection like an Enumeration. However, Iterators differ from enumerations in two ways:...
What is the Map interface?
What is the Map interface? - A Map maps keys to values. It cannot contain duplicate keys. The three general-purpose Map implementations are:..
Post your comment