Of course they work because a method called area that has no parameters exists. A method called getName that has no parameters exists. What doesn't exist is a method called showStyle that has one...
Type: Posts; User: Junky
Of course they work because a method called area that has no parameters exists. A method called getName that has no parameters exists. What doesn't exist is a method called showStyle that has one...
It has nothing to do with if you have parameters or not. What is does have to wdo with is if the parameters match.
class Foo {
public void methodOne() {
System.out.println("Lime");
...
System.out.println("Style is " + showStyle(shapes[i]));
On that line you are calling the showStyle method and passing a single parameter. The only showStyle method I can find in your code has no...