Meaning of 'void'
hi All, I'm having trouble understanding the concept of methods returning/not returning data. for example : class MyClass { static void sayHello() { System.out.println("Hello World!"); } public static void main(String[ ] args) { sayHello(); } } in the Java tutorial it says that the sayHello() method doesn't return any data because it is classified as 'void' but, as I see it ( wrongly obviously :) ), the method does return data - it prints "Hello World". What am I not getting ? Thanks in advance for any help given ~ ââââââââââEDITâââââââââ After reading all the answers, I guess my question is : What is the difference between the original code ( written above ) and this code, in terms of syntax, as it has the same result ? class MyClass { // I wrote âStringâ instead of âvoidâ static String sayHello() { System.out.println("Hello World!"); } public static void main(String[ ] args) { sayHello(); } }