what does void mean?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

what does void mean??

16th Jun 2016, 12:22 PM
Ankit
Ankit - avatar
8 Answers
+ 6
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.
16th Jun 2016, 4:21 PM
Aamir Bashir
Aamir Bashir - avatar
+ 3
it means that no value is expected to be returned
16th Jun 2016, 1:32 PM
Samuel Recker
Samuel Recker - avatar
+ 3
Function Can Produce Output to Output Unit Such As Console but Does Not Returns Any Value... Hope U Got My Answer.
16th Jun 2016, 4:23 PM
Aamir Bashir
Aamir Bashir - avatar
+ 2
The program having output to the console or what have you doesn't equate to the method returning a value.
16th Jun 2016, 3:46 PM
William McKinley
William McKinley - avatar
+ 1
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...
21st Aug 2016, 2:39 PM
avy7352
avy7352 - avatar
0
if it doesn't return anything so how come there will be output
16th Jun 2016, 1:35 PM
Ankit
Ankit - avatar
0
@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.
26th Jun 2016, 4:02 AM
Anil Kumar
Anil Kumar - avatar
0
if we are not expecting any return value or object from a method then we write this void.
17th Jul 2016, 4:08 AM
Dasari Naveen
Dasari Naveen - avatar