1/31
Looks like no tags are added yet.
UML class diagram
describes the relationships between the classes in a software system, also describes the overall design of a software system
what do UML class diagrams include
what 4 kinds of visbailitys are there
public + ,
# protected,
- private
˜ package
generalisation
the relationship between a sub class (parent) and its sub class (child)
also known as an ‘ is an ‘
eg a car is a vehicle
association
description of a relationship between two or more classes
aggregation
is a kind of association known as a ‘has a ‘ relation
eg a book has a chapter
composition
considered a more specific kind of aggregation known as a ‘ owns a ‘
encapsulation meaning
the ability to protect and manage its own information
basically make it difficult for any other objects to chnage or modify the value of the variable inside the class
Inheritance
classes can be created from other classes using inheritance
its used becuase we can reuse code
a class that inherits attributes is called a sub class
abstraction
the process of confining/ removing unnecessary details and only keeping the most important information
what is relevant to that person is kept
how to create objects
int x; * creates a variable called x to hold a primitive integer
integer y ; * creates a variable y to hold a referenct to an object of the integer class
y = new integer (74) * creates a new integer object with a value of 74 and sets the object reference variable y to point at new object
how to import
java.until. (whatever yur importing)
instance data
the location at which a variable is declared defines its scope
can be refrenced in any method of the class
Class library
A set of classes that supports the development of programs, often supplied as part of a language or by third-party vendors.
Java standard class library
A collection of classes, such as String, that is part of every Java environment but is not an inherent part of the Java language itself.
Package
A grouping of related classes in the standard class library that is given one package name.
how to write a package
package dsaj;
import java.until.stack
public class pure stack
constructor
ts job is to give the object its starting values.