Skip to content

Commit

Permalink
Merge pull request #3035 from SlideeScherz/patch-1
Browse files Browse the repository at this point in the history
Fixed whitespace typo in Class diagram
  • Loading branch information
ashishjain0512 authored May 17, 2022
2 parents bda13c4 + 0c65ea2 commit 6d2c6c1
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions docs/classDiagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,27 @@ The class diagram is the main building block of object-oriented modeling. It is
Mermaid can render class diagrams.

```mermaid-example
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
```

## Syntax
Expand Down Expand Up @@ -79,12 +78,12 @@ There are two ways to define the members of a class, and regardless of whichever
- Associate a member of a class using **:** (colon) followed by member name, useful to define one member at a time. For example:

```mermaid-example
classDiagram
class BankAccount
BankAccount : +String owner
BankAccount : +BigDecimal balance
BankAccount : +deposit(amount)
BankAccount : +withdrawal(amount)
classDiagram
class BankAccount
BankAccount : +String owner
BankAccount : +BigDecimal balance
BankAccount : +deposit(amount)
BankAccount : +withdrawal(amount)
```

- Associate members of a class using **{}** brackets, where members are grouped within curly brackets. Suitable for defining multiple members at once. For example:
Expand Down

0 comments on commit 6d2c6c1

Please sign in to comment.