Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 04-11-2018, 09:15 PM   #1
Jessicca
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.
Jessicca is offline   Reply With Quote

Old 03-18-2019, 03:34 AM   #2
adityadev
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.
adityadev is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT -7. The time now is 12:59 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.