I wanted to ask if I was currently reading Java literature, but I still didn’t understand why void returns nothing.
For example:
public void firstMethod(){ System.out.println("Hello!"); } In fact, the word "Hello" is returned to us as I understand it.
But I scored the code in Intellij idea:
public void run(){ return 10; } The idea began to swear, they say change to public int run() .
Not really understood (void returning nothing), please explain.