Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

object

Former Member
0 Likes
343

After the program is executed what happens to the instance of a class

2 REPLIES 2
Read only

jaideeps
Product and Topic Expert
Product and Topic Expert
0 Likes
320

hi,

the instance of class is mnothing but an object..and it will be destroyed..and in J2E engine which comes under the netweaver technology..we have garbage collector..this will tak care about the object deletion..

thanks

jaideep

reward if it is useful

Read only

Former Member
0 Likes
320

Hi Sandeep,

In ABAP, there is a system routine, that automatically deletes objects ( instances) that can no longer be addressed from the memory which is called a garbage collector. It releases the memory space they occupied.

For Eg.

Data: VAR1 TYPE REF TO CLASS1,

VAR2 TYPE REF TO CLASS1.

Now VAR1 & VAR2 are reference varibales.This acts a s a pointer to the objecct.

CREATE OBJECT VAR1.

Now VAR1 will have a momory space allocated in the system

.

CREATE OBJECT VAR2.

Now VAR2 will have a momory space allocated in the system .

Now if we do ,

VAR1 = VAR2.

Now both of the Variables are pointing to the same object . So one object will becone free.

This will get deleted by the garbage collector.