Sections


Main-Menu

header image

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.


Related Articles :



Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Shaadi.com Matrimony - Register for FREE