Ask Question
9 October, 05:34

If you have defined a class named SavingsAccount with a public static data member named numberOfAccounts, and created a SavingsAccount object referenced by the variable account20, which of the following will assign numberOfAccounts to numAccounts?

A) numAccounts = SavingsAccount. numberOfAccoun ts; B) numAccounts = numberOfAccounts; C) numAccounts = account20. numberOfAccounts; D) None of the above, you cannot reference a static data member.

+3
Answers (1)
  1. 9 October, 09:16
    0
    numAccounts = SavingsAccount. numberOfAccounts

    Explanation:

    In object oriented programming, when you have created an object of class, you can create several instances (objects) from that class by referencing the className. classFeild. In this instance SavingsAccount is the class name and

    numberOfAccounts is a feild (or data member). to create a new numAccount, we use the syntax as above in the answer
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “If you have defined a class named SavingsAccount with a public static data member named numberOfAccounts, and created a SavingsAccount ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers