# Attributes without type in Class Diagram

Hi,
I am using a book for studying UML. It shows attributes with out any data types:
isPrepaid
number: String
price: Money

What is the data type associated with above two i.e dataReceived & isPrepaid & what is their visibility (i.e publc /private). Some body please guide me.

Zulfi.

## Answers and Replies

Can you provide a screenshot of what you see? My guess is that there are other symbols there that you don't realize represent something. Are there what look like bullet points?

When designing classes for C++, I use these symbols:
Code:
+ dataReceived - public
- dataReceived - private
# dataReceived - protected
/ dataReceived - derived
~ dataReceived - "C" function
+^ dataReceived - public overridden
+v dataReceived - public virtual
+s dataReceived - public static

Usually, if the return type is not shown, it returns void, but considering that your isPrepaid function probably returns a bool, my assumption is that you're missing some information.

Hi,
I am using a book for studying UML. It shows attributes with out any data types:
isPrepaid
number: String
price: Money

What is the data type associated with above two i.e dataReceived & isPrepaid & what is their visibility (i.e publc /private). Some body please guide me.

Zulfi.
UML class diagrams usually include

Class name​
visibility attribute: type //for objects
----------------------------------------------
visibility operation(arg list types): return type // for methods​

visibility varies among groups of coders, organizations etc. But public(+) and private(-) are two most basic keys every class diagram should have.

Hi,
Thanks for your response.
<Usually, if the return type is not shown, it returns void, but considering that your isPrepaid function probably returns a bool, my assumption is that you're missing some information>
Its an attribute not an operation. Maybe iheadset is right:
<visibility attribute: type //for objects>
It should be a primitive data type.

Zulfi.

#### Attachments

• class diagram attribute without type.jpg
21.3 KB · Views: 398
Looks like just lazy UML diagramming to save space.