From 4c8016c62b6f67f6a66a2f4aa78dcb50d2602900 Mon Sep 17 00:00:00 2001 From: paltherr Date: Tue, 22 Jul 2003 12:45:22 +0000 Subject: - Added JavaInteraction --- test/files/jvm/JavaInteraction.check | 4 ++++ test/files/jvm/JavaInteraction.scala | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/files/jvm/JavaInteraction.check create mode 100644 test/files/jvm/JavaInteraction.scala (limited to 'test/files') diff --git a/test/files/jvm/JavaInteraction.check b/test/files/jvm/JavaInteraction.check new file mode 100644 index 0000000000..fb9d3cdd8c --- /dev/null +++ b/test/files/jvm/JavaInteraction.check @@ -0,0 +1,4 @@ +p.x = 5 +p.c = java.awt.Color[r=255,g=0,b=0] +p.getX() = 5.0 +p.getC() = java.awt.Color[r=255,g=0,b=0] diff --git a/test/files/jvm/JavaInteraction.scala b/test/files/jvm/JavaInteraction.scala new file mode 100644 index 0000000000..70eacebaf8 --- /dev/null +++ b/test/files/jvm/JavaInteraction.scala @@ -0,0 +1,24 @@ +//############################################################################ +// Test Java interaction +//############################################################################ +// $Id$ + +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); + System.out.println("p.x = " + p.x); + System.out.println("p.c = " + p.c); + System.out.println("p.getX() = " + p.getX()); + System.out.println("p.getC() = " + p.getC()); + } +} + +//############################################################################ -- cgit v1.2.3