KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Given the following Scala object: object ScalaObject { val NAME = "Name" } It appears that the Scala compiler generates a parameterless method to access the NAME field. However, when I try to access this field from Java, it looks like the only way to access this field is as a parameterless method like: System.out.println(ScalaObject$.MODULE$.NAME()); Is there a way to coax the Scala compiler to allow Java to access the val per the expected Java idiom as: System.out.println(ScalaObject$.MODULE$.NAME);
Tags (comma-separated)
Save Edits
Cancel