+ 1
Hi guys! Whats the difference btwn void and int? This two stuffs complicate my brain
2 Respuestas
+ 4
Void methods do not return anything, and int method must return any number, for example...
// int method
public int a() {
return 0;
}
// void method
public void b() {
}
+ 1
A void pointer can point to objects of any type but you can’t dereference it without a cast.
an int pointer points to an integer
Just imagine void as the absence of type and int as the type int