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 No correction required

B The long and short for it

C The long and short of it

D The shot and long for it

E The long or short for it

Q2: Which of the following statements are correct?

A Destructor is always called explicitly.

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

C Constructor is always called explicitly.

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

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

A Twice

B Thrice

C Only once

D Depends on the way of creation of object

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

A destructor

B constructor

C virtual function

D main

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

A delete[]

B free[]

C delete

D kill[]

E destructor

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

A A constructor has a void return type.

B A constructor has a return type.

C A constructor cannot contain a function call.

D A constructor has no return type.

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

A The parameterized destructor is called.

B The default constructor of the object is called.

C None of the above.

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 99

B 99.50

C ASCII value of 99

D Garbage value

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 print the output Aptitude.

B The program will print the output India.

C The program will report compile time error.

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 report compile time error.

B The program will report runtime error.

C The program will print the output 25.

D The program will print the output Garbage-value.