We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › static class variables
Pages: 1 2 
static class variables (Read 6300 times)
Re: static class variables
Reply #15 - Jun 17th, 2010, 5:20am
Interesting trick, Tiago, but the more classical way is to make instead an interface...
The interest is that you can "implement" several interfaces (so "import" several sets of constants) while you can extend only one class (thus your trick prevents you from doing real inheritance), and it is more logical in OOP terms.
But even that is deprecated, in newer version of Java, in favor of Static Import (the page explains why it is better).
Note that you might need latest version of Processing (> 1.1) to use this syntax.
Pages: 1 2