Which of the following statements is false?
a. Variables or functions listed after the public access specifier (and before the next access specifier, if there is one)
are “available to the public.” They can be used by other functions in the program, and by member functions of other
classes.
b. By default, everything in a class is private, unless you specify otherwise.
c. You must list an access specifier for every member.
d. Declaring data members private is known as data hiding. private data members are encapsulated (hidden) in an
object and can be accessed only by member functions of the object’s class.
c. You must list an access specifier for every member.
You might also like to view...
Give the following declarations, which of the following is a legal call to this function? int myFunction(int myValue);
int myArray[1000]; a. cout << myFunction(myArray); b. cout << myFunction(myArray[0]); c. myArray = myFunction(myArray); d. myArray[1] = myFunction(myArray[0]); e. A and B f. A and C g. B and D
Consider the abstract superclass below:
``` public abstract class Foo { private int a; public int b; public Foo(int aVal, int bVal) { a = aVal; b = bVal; } public abstract int calculate(); } ``` Any concrete subclass that extends class Foo: a. Must implement a method called calculate. b. Will not be able to access the instance variable a. c. Neither (a) nor (b). d. Both (a) and (b).