1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tia_tia [17]
3 years ago
5

Explain why you would need both public and privatemembers in a class.

Computers and Technology
1 answer:
inn [45]3 years ago
8 0

Answer:

In a class, a public data member are those member which can be accessible to all other classes in the computer program. By using public data member a class can modify its data member and its member function. Hence, the key member in class are not be declared as public.  

It is declared as:

class public

{

 public;    // public access specifier

  int a,b;      // Data Member

}

In a class, a private data member are only access by member function inside the class as, it is completely invisible from the outside world. In this, member function and class variable are private by default.

class private

{

private;   // private access specifier

 int a,b;    // Data Member

}

You might be interested in
Each object that is created from a class is called a(n) ____________ of the class.
gladu [14]
Instance





-------------------------
7 0
3 years ago
Read 2 more answers
Complete the sentence.
Artemon [7]

Answer:

encrypted

Explanation:

to prevent others from viewing it

4 0
3 years ago
Read 2 more answers
. What is suboptimization?
Vera_Pavlovna [14]

Answer: Suboptimization is referred to as a term that has been approved for common policy mistake. It usually refers to the practice of concentrating on a single component of a whole and thus making changes which are intended towards improving that component and also ignoring its effects on other components.

3 0
3 years ago
Does anyone know a NC wise owl password I can use, it's an emergency!! I can't ask my school because they are closed and I need
snow_tiger [21]
The password would be Apple 123
6 0
3 years ago
Why are people's visions of utopias and dystopias subjective?
Leno4ka [110]

Answer:

D. Because the technology needed for one person's utopia may be what creates disaster for another person's dystopia.

Explanation:

3 0
3 years ago
Other questions:
  • 3.A customer has a system with a Gigabyte B450 Aorus Pro motherboard. He wants to upgrade the processor from the AMD Athlon X4 9
    11·1 answer
  • What protocol must be supported by routers in order to utilize remote assistance easy connect?
    10·1 answer
  • A folder window shows you he contents of the folder
    8·1 answer
  • Under normal operations, cisco recommends that you configure switch ports on which vlan
    5·1 answer
  • What is a sluggish beta signal detection theory?
    15·1 answer
  • The actual database of Active Directory shared resources is stored on one or more computers designated as:
    6·1 answer
  • A palindrome is a word or phrase that reads the same both backward and forward. The word ""racecar"" is an example. Create an al
    15·1 answer
  • Someone pleaseee answer my last question i just posted ;-;
    6·2 answers
  • Any websites online to make $50 daily?​
    11·1 answer
  • What symbol do we use to assign a value to a variable or constant in algorithms?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!