Examveda

What is the correct way to define a method named PrintMessage that does not take any parameters and does not return any value in C#?

A. PrintMessage(void)

B. void PrintMessage(void)

C. PrintMessage()

D. void PrintMessage()

Answer: Option D


Join The Discussion

Related Questions on Functions and Methods in C Sharp