I have an already existing class written in Java (lets say this class is called X) that contains a field / member named type.
I now want to write a Scala class / object that creates an object of type X and access the type member of that object.
Yet, since type is a keyword in Scala, this does not work. The error message in Eclipse is: identifier expected but 'type' found.
Question: Is it possible to access that field without renaming it?
A working example:
Java Class:
public class X {
public final int type = 0;
}
Scala App:
object Playground extends App {
val x : X = new X();
System.out.println(x.type); // This does not work!
}