what does void mean??
It Has Many Meanings. Depending upon where u use it. 1) If used as Function Return Type, Then It Means It does Not returns Any Value To Calling Program. In "void main()" case it does not return any value to Operation System. 2) If Used for Declaring Data Type(E.G., in C Lang) Means It can Hold Any Type Of Value By Casting Machanism. 3) 2nd Specifies That it is used For Generic Types.
it means that no value is expected to be returned
Function Can Produce Output to Output Unit Such As Console but Does Not Returns Any Value... Hope U Got My Answer.
The program having output to the console or what have you doesn't equate to the method returning a value.
function has to define the return type like string or int if you don't want or your func doesn't return anything use void and then the func will not need to return nothing...
if it doesn't return anything so how come there will be output
@Ankit returning value and printing output to console are 2 different things. if you want to learn more about it please send your mail I'd. I will send you some sample code.
if we are not expecting any return value or object from a method then we write this void.