(I'm a bit new to programming so if this doesn't make sense just say so)
Let's say that a method takes in a void as parameter. Ex:
method(anotherMethod);
and I want to write the void inside of the brackets rather than writing the void and putting the name inside so rather than
void theVoid() {
doSomethingHere;
}
and then calling it like
method(theVoid());
I wanted to do
method({ doSomethingHere; })
directly, is it possible to do so?