[go: up one dir, main page]

0% found this document useful (0 votes)
6 views1 page

Creating Objects

Objects can be created in two ways: statically using 'Class_name obj_name;' and dynamically using 'Class_name obj_name = new Constructor();'. Dynamic allocation involves using 'new' to allocate memory and 'delete' to deallocate it.

Uploaded by

babbba48
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Creating Objects

Objects can be created in two ways: statically using 'Class_name obj_name;' and dynamically using 'Class_name obj_name = new Constructor();'. Dynamic allocation involves using 'new' to allocate memory and 'delete' to deallocate it.

Uploaded by

babbba48
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

there are 2 ways of creating objects:

1-statically
Class_name obj_name;

2- dynamically:

Class_name obj_name = new Constructr()

we allocate a memory using new dynamically


and deallocate it using delete

You might also like