<>scala Sample class

// Sample class object CaseDemo { def main(args: Array[String]): Unit = { // Defining sample classes
// The default parameter of the constructor is public case class Message( var sender:String,recipient:String ,body:
String) // Create an object for the sample class val messagel=Message("Jerry","Tom","Hello") println("sender:"
+messagel.sender) println("recipient:"+messagel.recipient) messagel.sender="Bob"
//sender use var It can be output when decorated println("sender2:"+messagel.sender)
//messagel.recipient="sss"//recipient Default use val modification } }
sender:Jerry recipient:Tom sender2:Bob Process finished with exit code 0

©2020 ioDraw All rights reserved
Vue Export page as PDF file vscode Used in Sass, And automatically compile to CSS file use python Program draw some simple cartoon characters Python Execution sequence of decorator ajax Method encapsulation Mining virus processing record Give Way Mac How to set the system not to sleep all the time C Language life game source code ValueError: Shape of passed values is (6, 3), indices imply (6, 6)C++——list Super detailed introduction