can someone pls help me with static non statci and access modifiers?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can someone pls help me with static non statci and access modifiers??

pls be eloborate

1st Oct 2016, 5:31 PM
pons ponmudi
pons ponmudi - avatar
3 Answers
+ 3
Static means that you can use the attribute/method without needing to instantiate an object of the class first, or in other words, as Mythos said, it is tied to the class rather than an instance of it. Access modifiers are: private (accessible only from within the class), protected (like private, except that derived classes have access too), public (accessible by everyone).
1st Oct 2016, 8:07 PM
Zen
Zen - avatar
0
static means its tied to the class. non-static would refer to an instance. within a class you have getters or setters. another name for these are accessors or mutators. they simply allow you to access or modify private variables within your class.
1st Oct 2016, 7:56 PM
Mythos
0
thanks
2nd Oct 2016, 1:57 AM
pons ponmudi
pons ponmudi - avatar