Static Constructs
Learn about static constructs in BoxLang, including static constructors and static methods.
Last updated
Was this helpful?
Was this helpful?
class MyFunkyCalculator{
// Static Constructor
static {
CACHE_KEY = "luis",
multiplier = 4
}
public static function calculate( a ){
return static.multiplier * a
}
public static function getGlobalCacheKey(){
return static.CACHE_KEY
}
}// Refer to the class by path, then use the :: and call a function or variable
MyFunkyCalculator::CACHE_KEY
MyFunkyCalculator::calculateValues( 1 )