Answer Posted / Mohit Rajan
Class variables are variables that are defined within a class or module and share their value across all instances of the class. They are prefixed with two '@' symbols (e.g., @@my_class_var). Global variables, as mentioned earlier, can be accessed anywhere in the program without an explicit qualifier and are prefixed with '$'. While global variables have broader scope, class variables help maintain shared state across instances of a class.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers