Ask Question
2 May, 07:26

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.

+1
Answers (1)
  1. 2 May, 09:48
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers