Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



#classes #scala
You already have seen all the examples using singleton objects where you called Scala's main method.
If you want to change selection, open document below and click on "Move attachment"

Scala Classes & Objects
singleton is a class that can have only one instance, i.e., object. You create singleton using the keyword object instead of class keyword. Since you can't instantiate a singleton object, you can't pass parameters to the primary constructor. <span>You already have seen all the examples using singleton objects where you called Scala's main method. Following is the same example of showing singleton: import java.io._ class Point(val xc: Int, val yc: Int) { var x: Int = xc var y: Int = yc def move(dx: Int, dy: Int) {


Summary

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

Details



Discussion

Do you want to join discussion? Click here to log in or create user.