spsingh32's Forum Posts

  • 1 posts
  • No, you cannot make truly universal instance variables in object-oriented programming. Instance variables are specific to each instance (object) of a class, meaning that each object will have its own copy of those variables. If you want a variable to be shared across all instances of a class, you would need to use class variables instead.

    Class variables are shared by all instances of the class, meaning any changes made to the class variable will affect all objects of that class. However, instance variables remain unique to each instance, and their values are not shared between objects.

    So, while you can share data across instances with class variables, instance variables are inherently tied to individual objects.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 1 posts