As i read through UML specification that:
class has a set of attributes/operations
and data type has a set of attributes/operations
1)with regards to attributes/operations of data type what this means?
because i don't know how such a data type has attributes and operations?
2)What’s the main difference between a class and a datatype?
according to UML 2.4.1 specification
1)Attributes/operations of data type have the same meaning than attributes/operations of classes i.e. attributes represent the structure of your data type and operations represent the method available on your data type.
2)The main difference between a class and a datatype is that it is not possible to have two instances of a datatype with the same values (these instance would be one unique instance).
Hoping it helps,
RB
In the Object Oriented (OO) approach , systems , including software , are made up of numerous objects that work together by exchanging information in the form of data values and ‘messages’ . An object is a specific instance of a Class like your dog (an object) is specific instance of the class of all dogs. Classes define what an object is like, and objects are practical instances that can be used and manipulated. As a definition, a class defines what properties will be used to describe every object based on this class. Within the object each of these properties will have a value that contributes to its description. Two objects of the same class will have the same properties, but they will have at least one property that has a different value in each of the objects – if all the properties have the same values in both of the two objects then they are the same object.
A data type refers to the attributes of an object and what type of data each attribute is, such as string, boolean, integer etc.
Operations or methods is what an object can do such as for a dog:
etc.
Have a look at this explanation of a Class Diagram, it will make more sense.