IndiaBIX
IndiaBIX
Start typing & press "Enter" or "ESC" to close
  • Home
  • Jobs
  • Results
  • Current Affairs
  • GK
  • Online Test
  • HR Interview
  • BLOG

Objects and Classes

  • Home
  • Computer Science & Engineering
  • C++ Programming Questions and Answers
  • Objects and Classes
1. 

Which of the following statements are correct for a static member function?

  1. It can access only other static members of its class.
  2. It can be called using the class name, instead of objects
A. Only 1 is correct.
B. Only 2 is correct.
C. Both 1 and 2 are correct.
D. Both 1 and 2 are incorrect.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

2. 

Which of the following statements is correct about the program given below?

class Bix
{
public:
static void MyFunction();
};
int main()
{
void(*ptr)() = &Bix::MyFunction;
return 0;
}

A. The program reports an error as pointer to member function cannot be defined outside the definition of class.
B. The program reports an error as pointer to static member function cannot be defined.
C. The program reports an error as pointer to member function cannot be defined without object.
D. The program reports linker error.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

3. 

Which of the following is the only technical difference between structures and classes in C++?

A. Member function and data are by default protected in structures but private in classes.
B. Member function and data are by default private in structures but public in classes.
C. Member function and data are by default public in structures but private in classes.
D. Member function and data are by default public in structures but protected in classes.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

4. 

Which of the following means "The use of an object of one class in definition of another class"?

A. Encapsulation
B. Inheritance
C. Composition
D. Abstraction

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

5. 

Which of the following can be overloaded?

A. Object
B. Functions
C. Operators
D. Both B and C

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

6. 

What does a class hierarchy depict?

A. It shows the relationships between the classes in the form of an organization chart.
B. It describes "has a" relationships.
C. It describes "kind of" relationships.
D. It shows the same relationship as a family tree.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

7. 

Which of the following statements is correct?

A. Data items in a class must be private.
B. Both data and functions can be either private or public.
C. Member functions of a class must be private.
D. Constructor of a class cannot be private.

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

8. 

Which of the following statements is correct when a class is inherited privately?

A. Public members of the base class become protected members of derived class.
B. Public members of the base class become private members of derived class.
C. Private members of the base class become private members of derived class.
D. Public members of the base class become public members of derived class.

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

  • 1
  • 2
  • 3

Questions & Answers

Aptitude Chemical Engineering Civil Engineering Computer Science & Engineering Current Affairs Data Interpretation Electrical & Electronics Engineering Electronics & Communication Engineering General Knowledge Logical Reasoning Mechanical Engineering Non Verbal Reasoning Verbal Ability Verbal Reasoning

Interviews

HR Interview

Jobs

Sarkari Jobs

Results

Rojgar ResultSarkari Result

Admission

Admission 2023

Admit Card

Admit Card 2023

Answer Key

Answer Key 2023
copyright
Privacy Policy
© 2025 IndiaBIX. All Rights Reserved.

Report