noopのBoolean型
noopにBoolean型が実装されたみたいです。
10f733a293 - noop - Project Hosting on Google Code
Booleanクラスには以下のメソッドが定義されてました。
- and
- or
- xor
- not
- toString
試してみよう
import noop.Application; import noop.Console; class HelloBoolean(Console console) implements Application { Int main(List args) { Boolean t = true; Boolean f = false; console.println( t ); // true console.println( f ); // false console.println( t.and(f) ); // false console.println( t.or(f) ); // true console.println( t.xor(f) ); // true console.println( t.not() ); // false return 0; } }
Booleanもオブジェクトなので、下のように直接メソッドを呼び出すことができました。
import noop.Application; import noop.Console; class HelloBoolean(Console console) implements Application { Int main(List args) { console.println( true.and(false) ); // false console.println( true.or(false) ); // true console.println( true.xor(false) ); // true console.println( true.not() ); // false return 0; } }