![]() |
#1 |
Registered User
Join Date: Apr 2018
Posts: 2
|
What is constructor and destructor in java?
In Java, constructors are like methods and each object is created by calling a constructor of the class with the new keyword. Some important features of a constructor are: A Constructor must have the same name as the class, They have no return type not even void. A Constructor can be public, private, protected. In Java, there is no destructor. But, Java provides a feature named Garbage collection and it’s an effective way for memory management instead of a destructor. Continue here to get one of the best site providing online dissertation services.
|
![]() |
![]() |
![]() |
#2 |
Registered User
Join Date: Jul 2017
Posts: 86
|
A Destructor is also a member function of a class, which deallocates the memory allocated to an object. ... Constructor is used to initialize the instance of a class.A constructor in Java is a block of code similar to a method that's called when an instance of an object is created.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
10 Avoidable Mistakes Every Beginner Java Developer Makes! | arshi1586 | Java | 0 | 11-08-2016 12:02 AM |
The conclusion provided by the Black Hat Java Script | andrebreton2121 | Search Engine Optimization | 6 | 10-17-2012 11:06 PM |
biggest teature of String in java? | cianfie | Java | 0 | 12-08-2011 09:03 PM |