Compound data type: Difference between revisions
Content added Content deleted
m (changed lang to geshi name) |
(add scala) |
||
Line 953: | Line 953: | ||
puts p |
puts p |
||
=> #<struct Point x=6, y=3></lang> |
=> #<struct Point x=6, y=3></lang> |
||
=={{header|Scala}}== |
|||
<lang scala>case class Point(x:Int=0, y:Int=0) |
|||
val p=Point(1,2) |
|||
println(p.y) //=> 2</lang> |
|||
=={{header|Scheme}}== |
=={{header|Scheme}}== |