concept void in category java

appears as: void
Java SE 11 Programmer I Certification Guide

This is an excerpt from Manning's book Java SE 11 Programmer I Certification Guide.

  • The return type of this method must be void.
  • interface Controls {
        void changeChannel(int channelNumber);
        void increaseVolume();
        void decreaseVolume();
    }

    The return type of a method specifies the type of value that a method will return. A method may or may not return a value. One that doesn’t return a value has a return type of void. A method can return a primitive value or an instance of any class. The return type can be any of the eight primitive types defined in Java, a class, or an interface. A method can also return an enum value, or an instance of inner class (however, these are not covered in this book since they are out of scope of the exam).