me again, newbie to scala and downvote is welcome if this question is stupid to you...
ok, I have a case class called "ListNode", and below is the error I got:
scala> case class ListNode[Int](vl: Int, nt: ListNode[Int] = null) {
| def value: Int = vl
| def next: ListNode[Int] = nt
| }
defined class ListNode
scala> var a = ListNode(1)
a: ListNode[Int] = ListNode(1,null)
scala> var b = ListNode(2)
b: ListNode[Int] = ListNode(2,null)
scala> a.next = b
<console>:11: error: value next_= is not a member of ListNode[Int]
a.next = b
^
I've read this and this and this and this and this, but still not really understand what it means...
Why cannot I just set the node next to be another node, just like in Java?
Thank you very much.