0

Can i insert a method into a method?

30th Mar 2020, 6:38 AM
Никита Сташулёнок
Никита Сташулёнок - avatar
5 odpowiedzi
+ 5
Никита Сташулёнок We can call method inside another method but we can't write method inside another method. As you are learning C# so we can do like this. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { Print(); } static void Print() { Console.WriteLine("Calling this method in Main method !"); CallInPrint(); } static void CallInPrint() { Console.WriteLine("Calling this method in Print method !"); } } }
30th Mar 2020, 6:42 AM
A͢J
A͢J - avatar
+ 3
Никита Сташулёнок Check my answer. I updated my answer and wrote how we can call methods.
30th Mar 2020, 6:46 AM
A͢J
A͢J - avatar
+ 1
Kindly specify your programming language in which you are asking for
30th Mar 2020, 6:38 AM
Muhammad Bilal
Muhammad Bilal - avatar
+ 1
Thank u
30th Mar 2020, 6:42 AM
Никита Сташулёнок
Никита Сташулёнок - avatar
0
C#
30th Mar 2020, 6:40 AM
Никита Сташулёнок
Никита Сташулёнок - avatar