Java

  • Public means that anyone can use it
  • Void means that this method is going to do something, but it won’t return any data (data received is nothing or data received is void) (void means nothing) (so nothing is received back; just output)
  • Every time you run a java program, it first looks for the keyword main and runs it from there

That’s why code like this:1gave me a result like this:2.PNGBecause the Java took from the first pre-existing code I wrote with main in it.

The code doesn’t have main in it, so Java doesn’t know where to look first. To set that up, where apples is main class:3

Advertisements