it should be both right ? According to me for S2, heap deallocation responsibility do depend upon programming languages. in case Of C , it need to be done manually WHile in java there is automatic garbage collector , so deallocation can happen at run time . so how would i say s2 is right or not unless progarmminglangauages is not specified .