Please explain static and void again | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please explain static and void again

8th Jun 2019, 7:56 PM
Sagnik Dutta
Sagnik Dutta - avatar
3 Answers
+ 6
static is used when that method or variable can be accessed by the class (not the object) Void is a return type meaning that function or method returns nothing.
8th Jun 2019, 7:57 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
Void is a function without return statement! Static is a called when variable or method can not be accessed by object!
8th Jun 2019, 9:30 PM
CodeFu
CodeFu - avatar
+ 1
✈️ 2617098409409140 ✈️ does that mean it is shared by the whole class?
8th Jun 2019, 8:26 PM
Cat Sauce
Cat Sauce - avatar