diff options
author | paltherr <paltherr@epfl.ch> | 2003-07-22 12:45:22 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-07-22 12:45:22 +0000 |
commit | 4c8016c62b6f67f6a66a2f4aa78dcb50d2602900 (patch) | |
tree | dcccbb1dd68d8092d03a0a51677485112d44b4c4 /test/files/jvm/JavaInteraction.scala | |
parent | 6d4a913e0fe41ee3742a52f5848003e03c61d9b0 (diff) | |
download | scala-4c8016c62b6f67f6a66a2f4aa78dcb50d2602900.tar.gz scala-4c8016c62b6f67f6a66a2f4aa78dcb50d2602900.tar.bz2 scala-4c8016c62b6f67f6a66a2f4aa78dcb50d2602900.zip |
- Added JavaInteraction
Diffstat (limited to 'test/files/jvm/JavaInteraction.scala')
-rw-r--r-- | test/files/jvm/JavaInteraction.scala | 24 |
1 files changed, 24 insertions, 0 deletions
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()); + } +} + +//############################################################################ |