Académique Documents
Professionnel Documents
Culture Documents
___________________
Different types of Attributes in Runtime artifact Class
---------------------------------------------------------1) Instance attribute/variable
2) static attribute/variable ( or ) class variables
3) Constant
____________________________________________________________
Constant :
----------for Constant the initial value is MANDATORY.
AND THAT INITIAL VALUE of constant WILL be fixed value.
constant value can be accessed using "OBJECT reference"
"CLASSNAME"
Constants will be generated globally for all objects of that class
i,e
obj1, obj2, obj3 can access constant value ( bcoz constant is global )
instance attribute:
----------------for instance attribute , the initial value is OPTIONAL
and the value of instance attribute can be modified
instance attribute value can be accessed using "OBJECT REference" only
instance attributes will be generated locally for each and every separate object
i,e
static Attribute:
---------------for static attribute, the intial value is OPTIONAL
and the value of static attribute can be modified.
static attribute value can be accessed Using "object Reference'
"CLASSNAME"
static attribute is generated globally for all objects of that classs.
________________________________________________________
Note : for a classs, we can create any number of Objects
_____________________________________________________________
Note : For an Object, The memory is allocated based on 3 factors:
1) based on TYPE of Attribute
2) based on the Data TYpe of each attribute
3) based on the Number of Attributes
____________________________________________________________
_______________________________________________________
according to the diagram:
Obj1 can access/modify its own EMPID , its own EMPNAME
___________________________________________________________
obj2 cannot access/modify OBj1 related EMPID, EMPNAME
______________________________________
Instance methods:
-------------------Instance methods can access both STATIC Attributes
+
Instance attributes
i,e
Instance methods can access both Global Memory
+
Local Memory
Instance Methods can be accessed using "OBJECT REFERENCE " only