What’s the purpose of Static methods and static variables?

By ayush goel in 22 Sep 2023 | 11:17 am
ayush goel

ayush goel

Student
Posts: 346
Member since: 21 Sep 2023

What’s the purpose of Static methods and static variables?

22 Sep 2023 | 11:17 am
0 Likes
divas goyal

divas goyal

Student
Posts: 453
Member since: 22 Sep 2023

 - Static methods belong to the class rather than instances of the class. They can be called using the class name and are used for operations that don't depend on instance-specific data.

   - Static variables (class variables) are shared across all instances of a class and are often used to maintain common state or constants.


22 Sep 2023 | 05:02 pm
0 Likes

Report

Please describe about the report short and clearly.