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

1 Answer

Answer :

D) Constructor

Related questions

Description : Which of the following is true about the static member variable in C++. i) It is initialized to zero when the first object of its class is created. Other initialization is also permitted. ii) It is visible only within ... , ii-True B) ii-False, ii-True C) i-True, ii-False D) i-False, iii-False

Last Answer : B) ii-False, ii-True

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 : 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 : Automatic conversion from primitive type to an object of the corresponding wrapper class is called: a) Coercing b) Casting c) Boxing d) Widening e) None of The Above

Last Answer : c) Boxing

Description : Write a program to declare class having data member as hrs, mins, secs. Write constructor to assign values and destructor to destroy values. Accept & display data for one object.

Last Answer : #include<iostream.h> #include<conio.h> class time { private: int hrs, mins,sec; public: time(int h,int m,int s) { hrs=h; mins=m; sec=s; } ~time() { cout<< hours ... } }; void main() { time t(2,43,56); t.display(); getch(); }

Description : Do You Know How Is Automatic Reference Junction Compensation Carried Out In Temperature Recorders?

Last Answer : In automatic reference junction compensation, variable nickel resistor is used. As the temperature changes, so does its resistance. This reference junction compensator is located, so that it will be ... the thermocouple is rejoined. This joint is invariably at the terminal strip of the instrument.

Description : How Is Automatic Reference Junction Compensation Carried Out In Temperature Recorders?

Last Answer : In automatic reference junction compensation, variable nickel resistor is used. As the temperature changes, so does its resistance. This reference junction compensator is located, so that it will be ... the thermocouple is rejoined. This joint is invariably at the terminal strip of the instrument.

Description : Which of the following is not a member of class ? (A) Static function (B) Friend function (C) Const function (D) Virtual function

Last Answer : (B) Friend function

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

Last Answer : Yes

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 : Which of the following is/ are the characteristics of friend function. A) It is not in the scope of the class to which it has been declared as friend. B) It can invoke like a normal function without the help of any object. C) Usually, it has the objects as arguments. D) All of the above.

Last Answer : D) All of the above.

Description : When an array is passed as a parameter to a function which of the following statements is correct? (A) The function can change values in the original array. (B) The function cannot change values in the original array. (C) Results in compilation error. (D) Results in runtime error.

Last Answer : (A) The function can change values in the original array.

Description : When an array is passed as parameter to a function, which of the following statements is correct ? (A) The function can change values in the original array. (B) In C, parameters are passed by value, ... . (D) Results in a run time error when the function tries to access the elements in the array.

Last Answer : (A) The function can change values in the original array.

Description : What is super constructor?

Last 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.

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 : 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 : 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 : When one object reference variable is assigned to another object reference variable then (A) a copy of the object is created. (B) a copy of the reference is created. (C) a copy of the ... not created. (D) it is illegal to assign one object reference variable to another object reference variable.

Last Answer : (B) a copy of the reference is created.

Description : State True or False. i) A satic function can have access to only other static members (functions or variables) declared in the same class. ii) A static member function can be called using the class name (instead of its objects) A) True, True B) True, False C) False, True D) False, False

Last Answer : B) True, False

Description : State true of false. i) We cannot make the function inline by defining a function outside the class. ii) A member function can be called by using its name inside another member function of the same class, this ... of member function. A) True, True B) True, False C) False, True D) False, False

Last Answer : C) False, True

Description : The dereferencing operator ……… is used when the object itself is used width in the member pointer. A) ->* B) .* C) Any of the above D) None of the above

Last Answer : B) .*

Description : The dereferencing operator ………….. is used to access a member when we use pointers to both the object and the member. A) ->* B) .* C) Any of the above D) None of the above

Last Answer : A) ->*

Description : Which of the following is used to make an Abstract class ? (A) Making atleast one member function as pure virtual function (B) Making atleast one member function as virtual function (C) Declaring as Abstract class using virtual keyword (D) Declaring as Abstract class using static keyword

Last Answer : (A) Making atleast one member function as pure virtual function

Description : What is the difference between casting and coercion?

Last Answer : A: Type Casting refers to Explicit type conversion i.e. When the conversion takes place with the programmer’s intervention, whereas, Coercion refers to Implicit type conversion i.e. When the conversion takes place on its own without the programmer’s intervention.

Description : Which one of the following is correct, when a class grants friend status to another class? (A) The member functions of the class generating friendship can access the members of the friend class. (B) ... the friendship. (C) Class friendship is reciprocal to each other (D) There is no such concept.

Last Answer : All member functions of the class granted friendship have unrestricted access to the members of the class granting the friendship. 

Description : Which of the following is/are the fundamental semantic model(s) of parameter passing? (A) in mode (B) out mode (C) in-out mode (D) all of the above

Last Answer : (D) all of the above

Description : Which of the following cannot be passed to a function? A) Reference variable B) Arrays C) Class objects D) Header files

Last Answer : D) Header files

Description : Which of the following statement(s) is/are correct with reference to curve generation? I. Hermite curves are generated using the concepts of interpolation. II. Bezier curves are generated using the concepts of approximation. III. The ... (B) II and III only (C) I and II only (D) I, II and III only

Last Answer : (D) I, II and III only

Description : Please don't know what to do with it?

Last Answer : Did you try to reinstall them? ☠ ☠ ☣ ☠ ☣ ☠ ☣ ☠ ☢

Description : How to initialization of array with example?

Last Answer : Initilization of Array : assigning the required information to a variable before processing is called initialization.we can initialize the individual elements of an array. Array elements can be initialized at the time of declaration. Syntax : ... M','P','U','T','E','R'}; char b[] = COMPUTER ;

Description : Which of the class definition has/have initialization bock: a) First b) My Class c) Second d) Third e) None of The Above

Last Answer : d) Third

Description : Illustrate initialization of two dimensional array with example.

Last Answer : Two dimensional array: The array which is used to represent and store data in a tabular form is called as two dimensional array. Such type of array is specially used to represent data in a matrix form. ... where outer loop will increment row and inner loop will increment column. Eg : for(i=0;i

Description : The third type of comment is used by a tool called .................. for automatic generation of documentation. A) Java commenting B) Java generator C) Java doc D) Java loc

Last Answer : C) Java doc

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 : 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 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 : 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 : 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 : Write a program in C++ to declare a class measure having data members as add 1, add 2, add 3. Initialize the values of two data members using constructor and display their addition using function.

Last Answer : #include<iostream.h> #include<conio.h> class measure { public: int add1,add2,add3; measure(int a,int b) { add1=a; add2=b; } void cal() { add3=add1+add2; } void display() ... ;>a>>b; measure m1(a, b); m1.cal(); m1.display(); getch(); }

Description : Explain object as a function argument using following points with suitable example: (i) Pass by value (ii) Pass by reference

Last Answer : (i) Pass by Value: When an object is passed by value to a function, a copy of that object is created and changes are reflected on the copy object not on original object. Example: #include #include class Example { int x; public: Example(int a)  {  x=a;  }  void print()  { cout

Description : An outstanding functionality of SQL is its support for automatic ………… to the target data. A) programming B) functioning C) navigation D) notification

Last Answer : C) navigation

Description : Which of the following is not a mechanism that DHCP supports for IP address allocation? A) Automatic allocation B) Static allocation C) Dynamic allocation D) Manual allocation

Last Answer : B) Static allocation

Description : Which of the following is not a mechanism that DHCP supports for IP address allocation? A) Automatic allocation B) Static allocation C) Dynamic allocation D) Manual allocation

Last Answer : A) Automatic allocation

Description : What is NOT true about the tenure of the Speaker of the Lok Sabha? (a) He is no longer a Speaker if he ceases to be a member of the Lok Sabha due to any reason (b) When the Lok Sabha ... representative (d) When there's a deadlock in vote, the Speaker can cast his casting vote to break the deadlock

Last Answer : (b) When the Lok Sabha dissolves, the Speaker vacates his position simultaneously

Description : A pre-stressed concrete member (A) Is made of concrete (B) Is made of reinforced concrete (C) Is stressed after casting (D) Possesses internal stresses

Last Answer : Answer: Option D

Description : How do you reference a Parameter?

Last Answer : In Pl/Sql, You can reference and set the values of form parameters using bind variables syntax. Ex. PARAMETER name = '' or :block.item = PARAMETER Parameter name