summaryrefslogtreecommitdiff
path: root/test/files/jvm/JavaInteraction.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/jvm/JavaInteraction.scala')
-rw-r--r--test/files/jvm/JavaInteraction.scala23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/files/jvm/JavaInteraction.scala b/test/files/jvm/JavaInteraction.scala
new file mode 100644
index 0000000000..1316fad5d4
--- /dev/null
+++ b/test/files/jvm/JavaInteraction.scala
@@ -0,0 +1,23 @@
+//############################################################################
+// Test Java interaction
+//############################################################################
+
+import java.awt.Color;
+import java.awt.Point;
+
+class ColoredPoint(x: Int, y: Int, c_ : Color) extends Point(x, y) {
+ val c: Color = c_;
+ def getC(): Color = c;
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val p = new ColoredPoint(5, 7, Color.RED);
+ Console.println("p.x = " + p.x);
+ Console.println("p.c = " + p.c);
+ Console.println("p.getX() = " + p.getX());
+ Console.println("p.getC() = " + p.getC());
+ }
+}
+
+//############################################################################