When we create objects of one class its constructor is invoked and we call its destructor then can we again use the object after | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 3

When we create objects of one class its constructor is invoked and we call its destructor then can we again use the object after

When we create objects of one class its constructor is invoked and we call its destructor then can we again use the object after destruction?

24th Oct 2021, 12:55 PM
Abhishek Pandey
Abhishek Pandey - avatar
2 ответов
+ 2
But, in c++, when i performed it it ran successfully.
1st Dec 2021, 10:06 PM
Abhishek Pandey
Abhishek Pandey - avatar
+ 1
No. A System.NullReferenceException would be raise. (C#) In others language should it be near the same.
24th Oct 2021, 1:26 PM
Stefanoo
Stefanoo - avatar