#deleting objects

1 messages ยท Page 1 of 1 (latest)

humble mesa
#

Developers should we have to kill the object when we had used it like c or cpp?

rotund cryptBOT
#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

reef solstice
#

java has a garbage collector

#

it automatically deletes any object that isnt used anymore

#

so you simply dont have to bother

fast summit
#

yeah, in C/C++ you do that manually

#

but in java the gc is kind and does it for you

rotund cryptBOT
#

deleting objects

#

Changed the title to deleting objects.

eternal pier
#

@humble mesa if there is no pointer to an allocated block , garbage collector frees it, thats one of the major factor that makes java slower than C

#

also m not a mod here but please dont make multiple threads just ask all you want in one ๐Ÿ™

fast summit
eternal pier
#

i think these questions can be termed under JAVA BASICS thats why I said so

#

since the person has been asking about java as a language, not the code itself.

#

welp, I am no expert , i may be completely wrong here.

reef solstice
#

cant really generalize it

eternal pier