Question

Members of a class that are declared private may be accessed a) only by methods of...

Members of a class that are declared private may be accessed

a) only by methods of the class.

b) only by methods of the class or friends of the class.

c) only by methods of the class, subclasses of the class, or friends of the class.

d) by any code.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Members of a class that are declared private may be accessed a) only by methods of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • If one member of a class is private, all the members of that class must also...

    If one member of a class is private, all the members of that class must also be declared as private. True or False?

  • Create a class for working with complex numbers. Only 2 private float members are needed, the...

    Create a class for working with complex numbers. Only 2 private float members are needed, the real part of the complex number and the imaginary part of the complex number. The following methods should be in your class: a. A default constructor that uses default arguments in case no initializers are included in the main. b. Add two complex numbers and store the sum. c. Subtract two complex numbers and store the difference. d. Multiply two complex numbers and store...

  • C++ True or False (True → CAN be accessed, False → CANNOT be accessed) A public...

    C++ True or False (True → CAN be accessed, False → CANNOT be accessed) A public variable declared in class ABC CAN be accessed: - a, From a member function of class ABC? - b. From a member function of a child class of ABC? c. From a friend function of class ABC, accessed using the dot operator? - d. From a member function of a friend class of ABC, accessed using the dot operator? - e. From an otherwise...

  • Question 19 Given the following class: public class Swapper ( private int x; private String y...

    Question 19 Given the following class: public class Swapper ( private int x; private String y public int z; public Swapper( int a, String b, int c) ( x-a; y b; zC; public String swap() ( int temp -x; x-z z temp; return y: public String tostring() ( if (x<z) return y: else return" +x+z What would the following code output? Swapper r new Suapper( 5, "no", 10); System.out.printin( r. swap ) ): no no510 510 e 15 Question 20...

  • in c++ Define and implement the class Employee with the following requirements: private data members string...

    in c++ Define and implement the class Employee with the following requirements: private data members string type name a. b. double type hourlyRate 2. public member functions a. default constructor that sets the data member name to blank"and hourlyRate to zero b. A constructor with parameters to initialize the private data members c. Set and get methods for all private data members d. A constant method weeklyPay() that receives a parameter representing the number of hours the employee worked per...

  • Java Code: 2. Define a class ACCOUNT with the following members: Private members Acno of type...

    Java Code: 2. Define a class ACCOUNT with the following members: Private members Acno of type int Name of type String Balance of type float Public members void Init) method to enter the values of data members void Show) method to display the values of data members void Deposit(int Amt) method to increase Balance by Amt void Withdraw(int Amt) method to reduce Balance by Amt (only if required balance exists in account) float RBalance() member function that returns the value...

  • if a variable is declared as private in a module outside of a sub, it cannot...

    if a variable is declared as private in a module outside of a sub, it cannot be accessed by any sub in that module true or false

  • The following is the class definition for Multiplier. This class has five (5) members: two private...

    The following is the class definition for Multiplier. This class has five (5) members: two private instance variables two private methods one public method this is only public method for the class it calls other two private methods import java.util.*; //We need to use Scanner & Random in this package public class Multiplier {        private int answer; //for holding the correct answer        private Random randomNumbers = new Random(); //for creating random numbers        //ask the user to work...

  • c ++ Create a class Book with the data members listed below.     title, which is...

    c ++ Create a class Book with the data members listed below.     title, which is a string (initialize to empty string)     sales, which is a floating point value (as a double, initialize to 0.0) Include the following member functions:     Include a default constructor,     a constructor with parameters for each data member (in the order given above),     getters and setter methods for each data member named in camel-case. For example, if a class had a data...

  • In Java please, These are instance methods which modify the linked list ,* accessed through the...

    In Java please, These are instance methods which modify the linked list ,* accessed through the instance variable: first * Note that this list keeps track of the number of elements in the instance varible N * It is important that N accurately reflect the length of the list. * You may not add any fields to the node or list classes. * You may not add any methods to the node class. static class Node ; } public Node...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT