What is the Void in c#?

0 votes
203 views
Pradeep kumar Patel asked 01-Nov-2019 in Programming Language by Pradeep kumar Patel

 What is the Void in c#?

1 Answer

0 votes
Shikhar Arora answered 12-Nov-2019 by Shikhar Arora
The void keyword is used as a return type for a method. When we declare or define a method with the void keyword, it means that the method cannot return any value. The void keyword cannot be used in a parameterized method. A method with no parameters or return value is declared below:
public void SampleMethod()

{
    // Body of the method.
}