+ 5

Can I create a method inside another?

I've created a method inside Main, but it didn't work. It only was functional when I created it out of Main.

1st Mar 2017, 12:42 AM
Andrés Barrera
Andrés Barrera - avatar
2 Answers
+ 14
You can't have methods in another method. You can, however, have anonymous/lambda functions.
1st Mar 2017, 1:52 AM
Jafca
Jafca - avatar
+ 3
No, but you can call other methods within a method.
2nd Mar 2017, 9:09 AM
Anthony Vanover
Anthony Vanover - avatar