Java Java Objects Meet Objects Constructors

Kiem Ruach
Kiem Ruach
2,248 Points

Java Workspaces

Example.java:7: error: cannot find symbol
System.out.printf("The dispenser is %s", dispenser.getCharacterName);
^
symbol: variable getCharacterName
location: variable dispenser of type PezDispenser
1 error

I keep getting this error

Steven Parker
Steven Parker
200,698 Points

To facilitate analysts of the issue, make a snapshot of your workspace and post the link to it here.

1 Answer

If the getCharacterName is a method, there should be a parenthesis at the end like this, dispenser.getCharacterName().