Declaration of variables in classes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Declaration of variables in classes

In the lessons I can see they are declaring some variables in Private: (in the end) However, how can they use a variable , say x, and then declare it afterwards . Any help would be appreciated

22nd Dec 2016, 5:05 PM
Umang Majumder
Umang Majumder - avatar
1 Answer
0
if you dont specifying access specifier then it automatically private. its you wish order doesn't matters. you can declare public ,private and protected as yours order.
22nd Dec 2016, 6:37 PM
himanshu yadav
himanshu yadav - avatar