0 votes
195 views
in Operating System by
edited
what is constructor? Give its syntax and two rules to define constructor.

1 Answer

0 votes
by (98.9k points)
edited
In object-oriented programming, a constructor is a special method that is called when an object is created from a class. The purpose of a constructor is to initialize the object's data members and perform any other setup that is required before the object can be used.

Related questions

0 votes
1 answer 55 views
0 votes
1 answer 74 views
asked Apr 7, 2022 in Chapter 2 Work and Energy by Doubtly (98.9k points)
0 votes
1 answer 65 views
0 votes
1 answer 197 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

504 users

...