Object Declaration
Object Declaration
Syntax for declaring objects:
classname obj1,obj2,obj3,———-objn;
Here obj1, obj2, —, objn are the objects. Defining an object is similar to defining a variable of any data type.
For example for a class with name “hello”, the declaration would be as,
hello h1, h2;
thus, here h1 and h2 are the two objects of class hello.
Posted in Computer Science, Information Technology, Object Oriented Programming, Object Oriented Programming |
