what means "not enclossing class" hier in scala

Posted by echo on Stack Overflow See other posts from Stack Overflow or by echo
Published on 2011-01-13T15:22:54Z Indexed on 2011/01/13 15:53 UTC
Read the original article Hit count: 139

Filed under:
|

Hoi ,i am learning scala and trying to translate some java code to scala. Here are some of the code below in java that I want to translate

public class Note{
    protected void addNote(Meeting n) {
        //add n to a list
    }
 }

 public abstract class Meeting{

     public Meeting(String name,Note note){
         note.addNote(this)
     }
 }

when i translate them to scala

class Note{
    protected[Meeting] addNote(n:Meeting){
        //add n to list
    }
}

abstract class Meeting(name:String,note:Note){
    note.addNote(this)
}

then i got an error in class Note : Meeting is not a enclossing class.

what does it mean? I have tried packagename instead of Meeting,like this:protected[packagename] addNote(n:Meeting) ,but i doesnt work.

© Stack Overflow or respective owner

Related posts about scala

Related posts about protected