The void keyword
The void is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java programming language likewise the void keyword indicates the following :
- The void keyword represents a null type.
- The void keyword is often used as the return type of a called method to indicate that this called method is not going to return any value to the calling method.
Syntex: Here is the syntax that displays how to use the keyword void.
public class Myclass { public void doit() { <statements> return; } } |