summaryrefslogblamecommitdiff
path: root/test/files/jvm/JavaInteraction.scala
blob: 1316fad5d4950e3aa6c393eb39d67443420b7dcc (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


                                                                              











                                                                    



                                              



                                                                              
//############################################################################
// 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());
  }
}

//############################################################################