Hi members, just a simple question, how would I show a constant in an UML diagram?

For example, here is a double field the class contains.
- radius : double

But how would the constant PI (3.14159...) be shown?
- PI : constant??

Future thanks for the responses!

Recommended Answers

All 3 Replies

Its like this

PI : double = 3.14159


Sorry, above poster is correct. I changed my post to avoid confusion.

+PI: double = 3.141...

Oh yep. Syrne is correct. I forgot to put the access modifier.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.