What "static" method is for? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What "static" method is for?

12th Dec 2016, 7:47 PM
William
William - avatar
5 Answers
+ 5
Statics method, are class methods that can be access by using the class name, instead of creating a new object.
12th Dec 2016, 8:11 PM
Nahuel
Nahuel - avatar
+ 4
Static keyword means that the variable or method it accompanies is not attached to an instance of the class, and is the same throughout all instances. Additionally, static members do not require the use of an object to access them, they can simply be accessed by ClassName.MemberName (providing that it's public, of course).
13th Dec 2016, 12:18 AM
Cohen Creber
Cohen Creber - avatar
+ 1
I think it's too early for me to learn class and static notions
12th Dec 2016, 8:47 PM
William
William - avatar
0
Static is an access modificator, it defines de variable or function declared as static to work only inside the .c file
12th Dec 2016, 8:32 PM
Aldo Alexandro Vargas Meza
Aldo Alexandro Vargas Meza - avatar
0
Viceversa the "extern" metod, declare the variable as if its in another file declarated
12th Dec 2016, 8:37 PM
Aldo Alexandro Vargas Meza
Aldo Alexandro Vargas Meza - avatar