Content deleted Content added
Wikipedia:Categories for discussion/Log/2024 October 21#Category:Free compilers and interpreters |
|||
Line 50:
<syntaxhighlight lang="java">
public class
▲ public int i;
public Int(int i) {
this.i = i; }
public static Int zero = new Int(0);▼
public int get() {
return i;
}
public void set(int j) {
i = j;
}
}
</syntaxhighlight>
Line 62 ⟶ 73:
<syntaxhighlight lang="cpp">
#include <gcj/cni.h>
#include <
MyInteger* mult(MyInteger& p, int k) {
if (k == 0) {▼
}
▲ if (k == 0)
▲ return Int::zero; // Static member access.
▲ return new Int(p->i * k);
}
</syntaxhighlight>
|