1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
source("TestHarness.bsh");
assert(true);
class Foo55
{
int x;
Foo55() {
this(0);
assert( x == 42 );
assert( this.x == 42 );
this.x = 43;
assert( x == 43 );
assert( this.x == 43 );
}
Foo55( int a )
{
assert( x == 0 );
assert( this.x == 0 );
this.x = 42;
assert( this instanceof Foo55 );
}
void go1() {
this.x = 5;
assert( this instanceof Foo55 );
assert( this.x == 5 );
go2();
}
void go2() {
this.x = 6;
assert( this instanceof Foo55 );
assert( this.x == 6 );
}
}
f=new Foo55();
f.go1();
assert( f.x==6 );
complete();
|