Class

UML (Unified Modeling Language) is a graphic language for modeling the structure and behavior of object-focused programs. UML is widely used in the industry to design, develop and write sophisticated software. This page will focus on creating UML class diagrams, which describe the internal structure of the class and the interaction between classes.

The class diagram contains a rectangle for each class. It is divided into three parts.

1. The name of the class.

2. Names and types of fields.

3. Names, return types, and method parameters.


The name of the class should always begin with a capital letter.

The class should always be in the middle of the starting point.

The class should always be in bold type.

An abstract class name should be written in italics format.

Attributes is the visibility factor.

The middle box contains the class variables.

Operations is the methods.Ad Link


Example:



public class Example {

private int x;

protected int y;

public int z;

public Example() { ... }

public String toString() { ... }

private void foo(int x) { ... }

protected int bar(int y, int z) { ... }

}