static class members can only be accessed by using class so how are they are using it with object😑😑 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

static class members can only be accessed by using class so how are they are using it with object😑😑

15th Oct 2016, 12:21 PM
mansi
2 Answers
+ 3
Static means that the class members can be used without creating an object of the class, as they are tied to the class itself rather than a particular instance. So you can basically use static members whenever, wherever (providing its access isn't restricted), including in objects.
15th Oct 2016, 1:46 PM
Zen
Zen - avatar
0
but is it a compulsion that we can only used b y without creating object is there any?
15th Oct 2016, 1:48 PM
mansi