image not found

Oops! That page can't be found.


Directions to Solve

Which of phrases given below each sentence should replace the phrase printed in bold type to make the grammatically correct? If the sentence is correct as it is, mark 'E' as the answer.

Q1: The long or short of it is that I do not want to deal with that new firm.

A The long and short of it

B The long and short for it

C The long or short for it

D The shot and long for it

E No correction required

Q2: Which of the following statements are correct?

A Constructor is always called explicitly.

B Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.

C Constructor and destructor functions are not called at all as they are always inline.

D Destructor is always called explicitly.

Q3: How many times a constructor is called in the life-time of an object?

A Depends on the way of creation of object

B Thrice

C Only once

D Twice

Q4: Which of the following gets called when an object is being created?

A constructor

B destructor

C main

D virtual function

Q5: To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .

A kill[]

B destructor

C delete

D free[]

E delete[]

Q6: Which of the following statement is correct about constructors?

A A constructor has no return type.

B A constructor cannot contain a function call.

C A constructor has a return type.

D A constructor has a void return type.

Q7: Which of the following statement is correct whenever an object goes out of scope?

A None of the above.

B The parameterized destructor is called.

C The default constructor of the object is called.

D The default destructor of the object is called.

Q8: What will be the output of the following program?
#include<iostream.h> 
class AptitudeCrack
{
    int x; 
    public:
    AptitudeCrack(int xx, float yy)
    {
        cout<< char(yy);
    } 
}; 
int main()
{
    AptitudeCrack *p = new AptitudeCrack(35, 99.50f);
    return 0; 
}

A Garbage value

B 99

C ASCII value of 99

D 99.50

Q9: Which of the following statement is correct about the program given below?
#include<iostream.h> 
class AptitudeCrack
{
    public:
    AptitudeCrack()
    {
        cout<< 'India';
    }
    ~AptitudeCrack()
    {
        cout<< 'Aptitude';
    }
};
int main()
{
    AptitudeCrack objAptitude;
    return 0; 
}

A The program will report compile time error.

B The program will print the output Aptitude.

C The program will print the output India.

D The program will print the output AptitudeCrack.

Q10: Which of the following statement is correct about the program given below?
#include<iostream.h> 
class Aptitude
{
      int x; 
    public:
      Aptitude();
     ~Aptitude();
      void Show() const;
};
Aptitude::Aptitude()
{
    x = 25;
}
void Aptitude::Show() const
{
    cout<< x;
}
int main()
{
    Aptitude objB;
    objB.Show();
    return 0; 
}

A The program will print the output 25.

B The program will print the output Garbage-value.

C The program will report runtime error.

D The program will report compile time error.