Question

I saw this code

class BinTree1 implements BinTree{
    Object val;
    BinTree1 left, right;
    // abstr(null) = E
    // abstr (val, left, right) =
    // N((abstr left) val (abstr right))

    public BinTree1 (BinTree1 l, Object o, BinTree1 r){
        val = o;
        left = l;
        right = r;
    }

    public Object val() {
        return val;
    }

I wonder what this implements means? I was searching the web, but all I found was something about interfaces...

Was it helpful?

Solution

As is already stated in the comments: this is probably java code.

See this answer which explains the "implements" keyword and also the difference to the "extends" keyword which is corresponding to c++ inheritance. (You tagged your answer with c++ so I assume you know inheritance in c++ and were confused about the keyword.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top