What is super constructor?

1 Answer

Answer :

A: It is a constructor which is used to call the constructor of the super class and hence initialize the data members of the super class from within the sub class.

Related questions

Description : What is the similarity between a method and a constructor?

Last Answer : A: Below are some of the similarities: 1) Both of them are member methods of any class. 2) Both can be parameterised or non-parameterised. 3) Both can be overloaded.

Description : What is a copy constructor?

Last Answer : A: It is a constructor which takes object as parameter and copies the value of the instance variable of that object to another object (creates a copy of an object).

Description : What is a constructor?

Last Answer : A: It is a member function with the same name as that of a class and is automatically called for initializing the variables of an object.

Description : A ……………. takes a reference to an object of the same class as itself as an argument. A) Reference constructor B) Copy Constructor C) Self Constructor

Last Answer : B) Copy Constructor

Description : Which of the following characteristics of constructor are true. i) They should be declared in the public section. ii) They are invoked automatically when the objects are created. iii) They do not have return type and void also. ... and v C) Only i, iii, iv and v D) All i, ii, iii, iv and v

Last Answer : D) All i, ii, iii, iv and v

Description : Automatic initialization of object is carried out using a special member function called ………… A) Friend B) Casting C) Reference Parameter D) Constructor

Last Answer : D) Constructor

Description : A constructor that accepts no parameters is called the ………………. A) Paramless constructor B) No parameter constructor C) Default constructor D) Argumentless constructor

Last Answer : C) Default constructor

Description : Which of the following, in C++, is inherited in a derived class from base class ? (A) constructor (B) destructor (C) data members (D) virtual methods

Last Answer : (C) data members

Description : Implicit return type of a class constructor is: (A) not of class type itself (B) class type itself (B) a destructor of class type (D) a destructor not of class type 

Last Answer : (B) class type itself

Description : What is super keyword?

Last Answer : A: It is a keyword which is used to access the data members and methods of the super class from within the sub class.

Description : Using which keyword we can access value of the instance variables and class variables of that class inside the method of that class itself. A) super B) final C) this D) either super or this

Last Answer : C) this

Description : Reflexivity property says that X Y is true if Y is …………………. A) Subset of X B) Null set of X C) Super set of Y D) Subset of Y

Last Answer : A) Subset of X

Description : State true or false i) A candidate key is a minimal super key. ii) A candidate key can also refer to as surrogate key. A) i-true, ii-false B) i-false, ii-true C) i-true, ii-true D) i-false, ii-false

Last Answer : C) i-true, ii-true

Description : ………..defines the structure of a relation which consists of a fixed set of attribute-domain pairs. A) Instance B) Schema c) Program D) Super Key

Last Answer : B) Schema

Description : ................. maintains the list of free disk blocks in the Unix file system. (A) I-node (B) Boot block (C) Super block (D) File allocation table

Last Answer : (C) Super block 

Description : Drop Table cannot be used to drop a Table referenced by .................. constraint. (a) Primary key (b) Sub key (c) Super key (d) Foreign key (A) (a) (B) (a), (b) and (c) (C) (d) (D) (a) and (d)

Last Answer : (C) (d)

Description : Which of the following information about the UNIX file system is not correct? (A) Super block contains the number of i-nodes, the number of disk blocks, and the start of the list of free disk blocks. (B ... Each i-node is 256-bytes long. (D) All the files and directories are stored in data blocks. 

Last Answer : (C) Each i-node is 256-bytes long.

Description : Which one is correct w.r.t. RDBMS? (1) primary key ⊆ super key ⊆ candidate key (2) primary key ⊆ candidate key ⊆ super key (3) super key ⊆ candidate key ⊆ primary key (4) super key ⊆ primary key ⊆ candidate key

Last Answer : Answer: 2

Description : What is the role of constructor using default arguments?

Last Answer : A default constructor is any constructor that has no argumentsor where all required arguments are assigned default values. Thelatter provides a useful means of overloading a default constructorwithout incurring otherwise unnecessary code ... 0, double imaginary=0): re {real}, im{imaginary} {}// ...}

Description : How is the default constructor equivalent to a constructor having default arguments?

Last Answer : Any constructor that can be invoked without explicitly passingany arguments is a default constructor. Note that there can be onlyone default constructor so there can only be one ... combining two or moreconstructors into a single default constructor, thus reducingverbosity and code duplication.

Description : Who is known as the ‘Constructor of Modern France’?

Last Answer : Napoleon Bonaparte

Description : What is Static Constructor?

Last Answer : In C# it is possible to write a static no-parameter constructor for a class. Such a class is executed once, when first object of class is created. Class MyClass { static MyClass() { //Initialization Code for static fields and properties. } }

Description : What is Constructor?

Last Answer : A constructor is a special method whose task is to initialize the object of its class. 1. It is special because its name is the same as the class name 2. They do not have return ... can call the base class constructor 4. Constructor is invoked whenever an object of its associated class is created

Description : If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?

Last Answer : Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.

Description : Is constructor or destructor inheritance explicit or implicit? What does this mean?

Last Answer : Constructor or destructor inheritance is explicit…. Public Extended : base() this is called the constructor initializer.

Description : If I have a constructor with a parameter, do I need to explicitly create a default constructor?

Last Answer : Yes

Description : What is a constructor?

Last Answer : Answer:When we create instance of class a special method of that class, called that is constructor. Similarly, when the class is destroyed, the destructor method is called. These are general ... languages. It is initialized using the keyword New, and is destroyed using the keyword Finalize.

Description : If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?

Last Answer : Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.

Description : If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor? 

Last Answer : Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class. 

Description : C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write? 

Last Answer : Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there’s no implementation in it.

Description : Can a class have a static constructor?

Last Answer : Yes, a class can have a static constructor. Static constructors are called automatically, immediately before any static fields are accessed, and are generally used to initialize static class ... are referenced. Static constructors are called before instance constructors. An example is shown below.

Description : Does C# provide copy constructor?

Last Answer : No, C# does not provide copy constructor.

Description : Are constructors inherited? Can a subclass call the parent's class constructor? When?

Last Answer : Ans. You cannot inherit a constructor. That is, you cannot create a instance of a subclass using a constructor of one of it's superclasses. One of the main reasons is because ... developer the ability to override a superclasses constructor you would erode the encapsulation abilities of the language.

Description : Does Java provides default copy constructor ?

Last Answer : Ans. No

Description : Does Constructor creates the object ?

Last Answer : Ans. New operator in Java creates objects. Constructor is the later step in object creation. Constructor's job is to initialize the members after the object has reserved memory for itself.

Description : What is constructor ?Describe its special properties?

Last Answer : A constructor is a special method of class. which is invoked automatically , whenever an object of a class is created. It has the same name as its class and resides similar to a method. A constructor ... .  It can be overloaded.  It is automatically used to initialize the member of the object.

Description : What is a COPY CONSTRUCTOR and when is it called?

Last Answer : copy constructor is a method that accepts an object of the same class and copies it s data members to the object on the left part of assignement: class Point2D{ int x; int y; public int ... MyPoint.color = 345; Point2D AnotherPoint = Point2D( MyPoint ); // now AnotherPoint has color = 345

Description : Define a constructor - What it is and how it might be called

Last Answer : constructor is a member function of the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized. Ways of calling constructor ... memory on stack, the default constructor is implicitly called. Point2D * pPoint = new Point2D();

Description : Virtual constructor: Constructors cannot be virtual. Declaring a constructor as a virtual function is a syntax error. Does c++ support multilevel and multiple inheritance?

Last Answer : Yes.

Description : Write a C++ program to declare a class student with members as roll no, name and department. Declare a parameterized constructor with default value for department as ‘CO’ to initialize members of object. Initialize and display data for two students.

Last Answer : write a C plus plus program to declare a class which accept and display student information such as roll number division and percentage use get data and put data with required parameters

Description : Describe with examples, passing parameters to base class constructor and derived class constructor by creating object of derived class.

Last Answer : When a class is declared, a constructor can be declared inside the class to initialize data members. When a base class contains a constructor with one or more arguments then it is mandatory for the derived class to have a ... #include class base { int x; public: base(int a) { x=a; cout

Description : Write a C++ program to declare a class addition with data members as x and y. Initialize values of x and y with constructor. Calculate addition and display it using function ‘display’.

Last Answer : #include<iostream.h> #include<conio.h> class addition { int x,y; public: addition(int,int); void display(); }; addition::addition (int x1,int y1) { x=x1; y=y1; } void addition: ... y); } void main() { addition a(3,4); a.display(); getch(); }

Description : Define Constructor. List its types. 

Last Answer : Constructor: A constructor is a special member which initializes an object immediately upon creation. It has the same name as class name in which it resides and it is syntactically similar to ... . Types of constructors: 1. Default constructor 2. Parameterized constructor 3. Copy constructor 

Description : What is constructor? How user can declared constructor in derived class? Explain with example.

Last Answer : Constructor:- Constructor is a special member function which has same name as a class name and is used to initialize object during compile time of program. Declaring constructor in derived class If a base class contains a ... derived d(2,5); d.displaybase(); d.display(); getch(); }

Description : What is copy constructor? Explain with example.

Last Answer : Copy constructor: The copy constructor is a constructor which creates an object by initializing it with an object of the same class, which has been created previously. The copy constructor is used to: ... ; // Copy constructor is called here // Let us access values assigned by constructors cout

Description : Write a program which implement the concept of overloaded constructor.

Last Answer : #include #include class integer { int m,n; public: integer() { m=0; n=0; } //default constructor 1 integer(int a, int b) { m=a; n=b; } //Parameterized constructor 2 integer(integer &i) { m=i.m; n=i.n; } //copy constructor 3 }; void display() { cout

Description : What is parametrized constructor? Explain with example.

Last Answer : A constructor that can take arguments is known as parameterized constructor. In some applications, it may be necessary to initialize the various data members of different objects with different values when they ... object is created. Member function put displays the value of data member m . 

Description : What do you mean by overloaded constructor?

Last Answer : When more than one constructor function is defined in a class, it is referred as overloaded constructor. Each overloaded constructor function is invoked with respect to arguments pass in the function call.

Description : Write a program to declare class student having data members name and percentage. Write constructor to initialize these data members. Accept and display this data for one object.

Last Answer : #include<iostream.h> #include<conio.h> #include<string.h> class student { char name[20]; float per; public: student(char n[],float p) { strcpy(name,n); per=p; } ... { student S("Sachin",78.00); clrscr(); S.putdata(); getch(); }

Description : Describe multiple constructor by giving example.

Last Answer : Multiple constructor: Multiple constructors is a category of constructor in which a class can have more than one constructor. This is also known as constructor overloading. All constructors are defined with the same name as the class ... constructor 1 integer(int a, int b) { m = a; n = b; cout