Question: Static Variables & Methods Create a class called aThing with a blank constructor Create a static variable called numberOfThings in the class, which is incremented
- Static Variables & Methods
- Create a class called aThing with a blank constructor
- Create a static variable called numberOfThings in the class, which is incremented each time an instance of aThing is created
- Create a static method in aThing thats sole purpose is to print the current value of numberOfThings. Call it TotalOfThings
- Instantiate four instances of aThing and invoke TotalOfThings from main()
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
