The naming methods .setXxx() or .getXxx() is just a convention for JavaBeans . Unless you explicitly use your class as a bean (and Scanner , of course, is not one), you can name your methods as you like.
In addition, this .useDelimiter() method returns this , while JavaBeans installers return void . If this method complied with a bean, you could not write:
Scanner scanner = new Scanner(System.in).useDelimiter(xxx);
The only real convention with method names, unless you intend your class to be a bean, should be what they themselves explain.
source share