admin

admin

Generics

Generic Fundamentals A Simple Generic Example Bounded Types Sometimes it is useful to limit the types that can be passed to a type parameter. For example, assume that you want to create a generic class that contains a method that returns the average of an…

Polymorphism

Overview Why Override Methods? Using Abstract Methods There are situations in which you will want to define a superclass that declares the structure of a given abstraction without providing a complete implementation of every method. That is, sometimes you will want to…

Encapsulation and Access Modifiers

Controlling Access to Class Members Modifier Class Package Subclass World public Y Y Y Y protected Y Y Y N no modifier Y Y N N private Y N N N Tips on Choosing an Access Level Encapsulation Properly encapsulated…