final

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

final

示例
 finalfloat constant = 12.84753;

println(constant);

// Prints "12.84753" to the console constant += 12.84;

 // ERROR! It's not possible to change a "final" value 
描述 Keyword used to state that a value, class, or method can’t be changed. If the final keyword is used to define a variable, the variable can’t be changed within the program. When used to define a class, a final class cannot be subclassed. When used to define a function or method, a final method can’t be overridden by subclasses.

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.

Updated on October 2, 2018 05:02:16pm EDT

final