Skip to content

Instantly share code, notes, and snippets.

@Tarrasch
Created February 20, 2011 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Tarrasch/835936 to your computer and use it in GitHub Desktop.
Save Tarrasch/835936 to your computer and use it in GitHub Desktop.
Why does it say its final?
public abstract class Mixologist extends Person {
protected static Integer numServings = 0;
protected static synchronized void addServing()
{
numServings++;
}
...
}
Compiling Simulation
jrGen/Mixologist.java:26: cannot assign a value to final variable numServings
numServings++;
^
1 error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment