Oops
Description: This test contains questions on c++ | |
Number of Questions: 15 | |
Created by: Sharvani Hegde | |
Tags: programming Java/Oracle /C/C++ |
In an office, a clerk builds a logic using C++ to calculate salary of the employees, which is hidden from the other employees. Which feature of the language is he using?
Which of the following is the correct syntax of declaring a class in C++?
Which of the following statements is incorrect about classes in object oriented programming?
Identify the data member or the member variables in the above program.
class A
{
public: int a;
void display()
{
cout<<"Enter the value in a";
cin>>a;
}
};
void main()
{
A a1; a1.display();
getch();
}
A company launched a new car by adding or modifying some features in an existing car. Which feature of OOPS is implemented by the company?
Which of the following operators is used in C++ to implement operator overloading?
Which of the followng statements is incorrect about private access specifiers in C++?
Which of the following statements is incorrect about objects in C++?
In the above program, which is/are the possible reason(s) for not generating the output?
Class A
{
public: void display()
{
printf("This is class A");
}
};
void main()
{
A a1; a1.display();
getch();
}
How will you resolve ambiguity between functions in C++?
A person creates a class with the name 'A' in C++. He wishes to use the features of this class in class B. Which syntax will he use to implement this?
Name a function in C++ which provides initial values to the objects.
In which section of the program will you declare a friend function for the class?
Which of the following error messages is/are displayed to the user if the user improperly writes a header file in the above program? (Turbo C++)
#include"iostrem.h"
#include"conio.h"
void main()
{
cout<<"hi";
getch();
}
How will you implement multiple inheritance in C++?