What are constructors in oop?



What are constructors in oop?..

Answer / Rahul Chaudhary

In Object-Oriented Programming (OOP), a constructor is a special method that is used to initialize an object. It has the same name as the class and runs automatically when an object of that class is created.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

What is abstraction in oop?

1 Answers  


What is object in oop?

1 Answers  


What is abstraction and encapsulation?

1 Answers  


When is it necessary to use member-wise initialization list in C++?

2 Answers   Adobe,


Program to check whether a word starts with a capital letter or not.

1 Answers   Infosys,


Why u change company?

12 Answers   BOB Technologies,


Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.

1 Answers  


Generally, in all C++ programs, texts are in white colour. Can we change the colour of the text(either input or output or both)? If so, help me out.

1 Answers  


What is virtual class and friend class?

5 Answers   IBS, Intel, Wipro,


What are the 4 pillars of oop?

1 Answers  


what are the disadvantages of C++?

25 Answers   ATS, Infosys, UNI, Wipro,


the difference between new and malloc

5 Answers   Siemens,


Categories