What are the differences between public, private, and
protected access?
Answer Posted / koushik k reddy
Private:
It cannot be accessed by object and cannot be inherited, will be used only by the member functions of the class
Protected:
It cannot be accessed by the object and used by the member functions of the class can be inherited to first level of inheritance
Public:
It can be accessed by the objects and can be inherited to any level
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What you know about structures in C++?
What is the maximum value of a unsigned char a) 255 b) 256 c) 128
What is the difference between #import and #include?
Which programming language is best?
How do you establish an is-a relationship?
What is std :: endl?
What is the best c++ book for beginners?
Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?
Which coding certification is best?
What are stacks? Give an example where they are useful.
How does com provide language transparency?
How many different levels of pointers are there?
What is an iterator class in c++?
Write a program to find the Fibonacci series recursively.
What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass