The method "addOneToX()" does something, but doesn't return a value. That means I can write
Demo d = new Demo();
d.addOneToX();
But I can't legally write
Demo d = new Demo();
Q q = d.addOneToX();
no matter what "Q" is (i.e., int,
String, or anything else.) You can't assign the return value of addOneToX() to a variable, because there
is no return value.