Skip to content

Computing Functions StaticValues

anymaker edited this page Apr 3, 2021 · 1 revision

Functions that Return Static Values

Null Return null value
Nil Return null value such as Null. Use it when you can't save "null" in interface
True Return boolean value 'true'
False Return boolean value 'false'

Null

This function returns null

System.out.println(engine.calc("null"));
System.out.println(engine.calc("null") == null);

Output

null
true

Nil

Return null value such as Null. Use it when you can't save "null" in interface.

Return boolean value 'true'

System.out.println(engine.calc("true"));
System.out.println(Boolean.TRUE.equals(engine.calc("true")));
System.out.println(Boolean.FALSE.equals(engine.calc("true")));

Output

true
true
false

Return boolean value 'false'

System.out.println(engine.calc("false"));
System.out.println(Boolean.TRUE.equals(engine.calc("false")));
System.out.println(Boolean.FALSE.equals(engine.calc("false")));

Output

false
false
true