static





static \ Language (API) \ Processing 1.0
























Search processing.org:





Language (A-Z) \ Libraries \ Tools \ Environment \ Compare \ Troubleshooting






Reference for Processing version 1.0+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name static Examples void setup() { MiniClass mc1 = new MiniClass(); MiniClass mc2 = new MiniClass(); println( mc1.y ); // Prints "10" to the console MiniClass.y += 10; // The "y" variable is shared by mc1 and mc2 println( mc1.y ); // Prints "20" to the console println( mc2.y ); // Prints "20" to the console } static class MiniClass { static int y = 10; // Class variable }void setup() { println(MiniClass.add(3, 4)); // Prints "7" to the console } static class MiniClass { static int add(int x, int y) { return(x + y); } } Description Keyword used to define a variable as a "class variable" and a method as a "class method." When a variable is declared with the static keyword, all instances of that class share the same variable. When a class is defined with the static keyword, it's methods can be used without making an instance of the class. The above examples demonstrate each of these uses. This keyword is an essential part of Java programming and is not usually used with Processing. Consult a Java language reference or tutorial for more information, such as this one. Usage Web & Application

Updated on November 22, 2008 08:39:25pm PST












Processing was initiated by Ben Fry and Casey Reas. It is developed by a small team of volunteers.


© Info \

Site hosted by Media Temple!









Wyszukiwarka

Podobne podstrony:
Static
staticbase
Static Analysis of Binary Code to Isolate Malicious Behaviors
index static image
ECU VAG EDC15 STATIC
static
WS5 Linear Static Truss
static x push it
mod mmap static
2009 08?hesion Bonding Linking Static Applications with Statifier and Ermine
USING A PITOT STATIC TUBE FOR VELOCITY AND FLOW RATE MEASURE
flow static desc ynwslahtp3zkhicxyozjfpal7aa26rge3dmlntq
eFunda Theory of Pitot Static Tubes
static
Madonna X Static Process
Static
Answer LAB4 1 Static Default Route

więcej podobnych podstron