180 likes | 354 Views
Modularity. Methods & Class as program unit. A method is comprised of statement sequences and is often viewed as the smallest program unit to be considered as a subprogram. It is self-contained and designed for a particular task which represents an object behavior. .
E N D
Methods & Class as program unit • A method is comprised of statement sequences and is often viewed as the smallest program unit to be considered as a subprogram. It is self-contained and designed for a particular task which represents an object behavior.
Object & Class properties • Properties defined in a class can be distinguished into object and class proper-ties. • Object properties are definitions that are specific to objects and apply to all objects from the same class. • Class properties, on the other hand, apply only to the class even though the structure and behavior of objects of a class is defined by the class.
Class Attributes • The static variable count is also known as a class attribute. While a class definition specifies the structure and behavior of objects within, it may have its own attribute and method definitions.
Packages • While class definitions are practical modular units, the Java programming language has another mechanism that facilitates programming teams and reusable software units. • The package facility allows for appropriate classes to be grouped into packages. As with standard design rationale for objects where relevant methods are placed in the same class definition, packages in Java form the next level of software containment for classes with logically related functionality.