I’m working with project that will have ONLY one profile that has friends
I allready do that by
-
static class profile
-
class friend
-
profile has static collection of friends
but profile and friend have same variables as name , pic , .. etc
so i decide to make a person abstract class and inherit it
then i found that i can’t inherit static class [ profile ] from person as variables will not have properties
so i made variables as static in person
then every friend doesn’t have its variables as static variables will belongs to friend class
I’m new to this and i know it’s a silly question !!
but what’s the best way to implement this
I Preferred Using Static For Profile For Accessibility
I Preferred Using Static Things For Accessibility Purposes
Avoid using static classes. If you want one instance, just create one instance. Static classes make testing difficult.
But going back to design, maybe try introducing a User class: