JavaScript Required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Diagrams and visualizations using Mermaid
Diagrams and visualizations using Mermaid
More
Share
Explore
Diagrams and visualizations using Mermaid
Class Diagram
Documentation
Syntax
Theme
:
default
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
()
}
Class
class
BankAccount
BankAccount
:
+
String
owner
BankAccount
:
+
Bigdecimal
balance
BankAccount
:
+
deposit
(
amount
)
BankAccount
:
+
withdraw
(
amount
)
Define a class
class
Animal
Vehicle
<|--
Car
Setting the direction of the diagram
direction
RL
class
Student
{
-
idCard
:
IdCard
}
class
IdCard
{
-
id
:
int
-
name
:
string
}
class
Bike
{
-
id
:
int
-
name
:
string
}
Student
\
"1\"
--o
\
"1\"
IdCard
:
carries
Student
\
"1\"
--o
\
"1\"
Bike
:
rides
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.