Hemant Sharma

Hemant Sharma

  • NA
  • 8
  • 10.8k

optional parameter write methods

Jun 8 2014 12:37 AM
Hi all i am a absolute beginner of c#5.0 and i want to understand how the Console.Writeline is different for optional parameters e.g

class test
{
static void Prg(int a=0,int b=0,int c=0,int d=0)
{Console.Writeline(a,b,c,d);}
static void Main()
{
Prg();
}

i want to print values for a,b,c,d as 0 0 0 0 in o/p

but iit shows error as 'overload method has some invalid arguments.

tell me methods for Console.Write() for this code,thanks in advance.

Answers (6)