abstract class Number{
private Integer m_number;
Number(Integer m_number){
this.m_number=m_number;
}
public Integer getInteger(){
return m_number;
}
Number add(Number a,Number b){
return new Number(new Integer(a.getInteger().intValue()+
b.getInteger().intValue()));
}
String toString(){
return getInteger().toString();
}
}
class One extends Number{
static Number cached_one=new Number(Integer.parseInt(BigInteger.ONE.toString())); //cached for efficiency
static Number createNumberOne(){
return cached_one;
}
}
class Main{
public static void main(String[] args){
Number result=One.createNumberOne().add(One.createNumberOne());
System.out.println(result); //result.toString() is invoked here
}
}
I guess it's normally ASCII source coded so it wouldn't really qualify but there are no invalid sequences of syntactically meaningful characters. You could also treat other characters as comments (as is common in Brainfuck) or just use binary source coding to achieve the desired effect.