NCERT Solutions Class 12 Computer Science Constructor and Destructor

Scroll down to download pdf file

NCERT Solutions Class 12 Computer Science Constructor and Destructor. NCERT book for Computer Science in class 12 is strongly recommened by teachers and the CBSE and NCERT boards. Please download the NCERT solutions for class 12 Computer Science free in PDF made by teachers of the best schools in India. These solutions are carefully compiled to give detailed understanding of the concepts and also steps of solutions. The NCERT solutions are free to download in pdf format. Please refer to the download link below to download the pdf file and also refer to other chapters and subjects to get the solutions to Computer Science NCERT book questions and exercises.

Chapter - Constructor and Destructor

Question 1: Write four characteristics of constructor function used in a class. [Delhi, 2014]

Answer: (i) A constructor function has no return type.

(ii) Name of constructor is same as that of class.

(iii) A constructor can be called while creating objects.

(iv) If there is no constructor declared in class then default constructor is invoked. (1/2 mark for each characteristic).

Question 2: What is a copy constructor ? Give a suitable example in C++ to illustrate with its definition within a class and a declaration of an object with the help of it. [Delhi, 2015]

Answer: A copy constructor is an overloaded constructor in which an object of the same class is passed as reference parameter,

class point

{ int x ;

public :

point ( )

{

x = 0 ;

}

point (Point &p) // copy constructor {x = p . x;} };

void main ( ) {

point p1;

point p2 (p1) ; // copy constructor is called here //

OR

point p3 = p1 ; //Copy constructor is called here

}

Please click on link below to download NCERT Solutions Class 12 Computer Science Constructor and Destructor.

Tags: 


Click on the text For more study material for Computer Science please click here - Computer Science

Latest CBSE News

  • If you’re the one who opted for the medical stream because you liked studying biology. Unfortunately, you have been unable to clear the NEET exam and now worried about their future. Actually, most people think that career options for PCB end at medical. Today in this article we will be talking about some of the career options for PCB stream which students can pursue after class 12th. Here is the...
  • Board exams play a very important role in our lives. It boosts our knowledge and also helps to know our status in academic life. Both class 10th and class 12th play a very significant role in a student’s life.It also helps inselecting the stream of their own choice. So that in later, they can’t regret their decisions. Board exams are key factors in determining the course of student’s careers....
  • We all know CBSE has conducted every year board exams for class 10. As soon as we land in class 10, everyone starts suggesting different things. They tell us to study hard because this is the first step towards your career. If you are willing to take science stream in class 11th and 12th, then it is very important to get good marks in class 10. So that you can easily take your stream. Check out...
  • A computer has become very much important nowadays because it can perform tasks very easily, accurate and fast. Due to the increasing usage of computers, there are so many jobs available in enormous fields. If you are interested in working in fields of computers then these are the 3 main courses available for you i.e. BCA, B.TechComputer Science and B.Sc Computer Science. It may become confusing...
  • As all you know, the results of most state boards declared till the month of June, all intermediate or higher secondary pass students should think that how to choose the best career option for a bright and successful future. While some young people want to become doctors or engineers, others want to be teachers. If you are one of the third students to graduate to qualify for BEd and other teacher...
  • While the long-standing standards for picking streams in our nation have settled that toppers and tutorially-skilled undergrads normally float towards science, it's pursued being toppled. Undergrads, today, are proactively picking the business stream, regardless of their scholarly standing. In this way, in case you're needing to pick your stream once you are done with tenth, or have just settled...
  • With the increasing number of new technologies and an increasing global population, self-study is growing. Education is no longer restricted to just the classroom. For high school self-study is very important because class 10 and class 12 sets the base for life. Also, self-studying habits help high school students in preparing for a more independent learning environment in college. Download...