-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprogram3.q
More file actions
29 lines (26 loc) · 747 Bytes
/
program3.q
File metadata and controls
29 lines (26 loc) · 747 Bytes
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
use "lang/ji" = ji
_Pair = ji.SketchedJavaClass("public NumPair",
ji.SketchedJavaField("private double a"),
ji.SketchedJavaField("private double b"),
ji.SketchedJavaConstructor("public", ["double a", "double b"], function (this, a, b) {
this.a = a
this.b = b
}),
ji.SketchedJavaMethod("public double getA", [], function (this) {
return this.a
}),
ji.SketchedJavaMethod("public double getB", [], function (this) {
return this.b
})
)
pkg = ji.deployPackage(
ji.SketchedJavaPackage("me.tapeline.quailj.ji.test",
_Pair
),
"program3_q/JIGenerated",
["me.tapeline.quailj.ji.test.NumPair"]
)
Pair = pkg[0]
pair = Pair(3, 6)
print(pair.getA())
print(pair.getB())