I've been watching videos and doing tutorials but i still don't understand the difference between these two things. Can anyone help?


1 2 3 4 5 6 7 8 | class Example{ public void printHi(){ printString( "Helooooo" ); } private void printString(String str){ System.out.println(str); } } |
1 2 | Example e1 = new Example(); e1.printHi(); |
1 2 | Example e1 = new Example() e1.printString( "Heloooo" ); |