scala - How to access a field of a super-class which is implemented in Java which also has an equal-named method? -


i want extend class implemented in java. here example:

public interface javainterface {     /** computes foo. */     public string foo(); }  public class thisisjava implements javainterface {     protected string foo = "foo";      /** returns value of property foo. */     public string foo() { return foo; } } 

but how disambiguate between field , method foo when extend class in scala?

class thisisscala extends thisisjava {   def foobar = super.foo + "/bar" // doesn't compile } 

you cannot access foo field because it's private. can access super.foo().

update: think have problem because in scala there no distinction between fields , methods, option option have adapter thisisjava, , extend adapter in scala.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -