0
Can i insert a method into a method?
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 !");
}
}
}
+ 3
Никита Сташулёнок Check my answer. I updated my answer and wrote how we can call methods.
+ 1
Kindly specify your programming language in which you are asking for
+ 1
Thank u
0
C#