CJCoding With Joseph

Static Instance Counter

The Widget class keeps a private static field count that increases by 1 each time a Widget is constructed. Add a public static read-only property Count that returns this shared field. Do NOT write a Main method.

After creating three widgets the program prints:
3

Expected Output:

3
Topics:
Encapsulation
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.