File: class4.bsh

package info (click to toggle)
bsh 2.0b4-20
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 4,224 kB
  • sloc: java: 23,431; xml: 4,500; sh: 139; makefile: 24
file content (34 lines) | stat: -rw-r--r-- 383 bytes parent folder | download | duplicates (10)
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
#!/bin/java bsh.Interpreter

source("TestHarness.bsh");

class Foo44 {
	int a=5;
}

class Bar44 {
	int b=5;
	Bar44() {
		b=6; // change value
	}
}

class Gee44 {
	int c=5;
	Gee44( int x ) {
		c=x;
	}
}

foo=new Foo44();
assert(foo.a==5);

bar=new Bar44();
assert(bar.b==6);

assert(isEvalError("new Gee44()")); // no default const
gee=new Gee44(42);
assert(gee.c==42);

complete();