What is the difference between these two classes:
class Person {
var name : String = _
var surname: String = _
}
class Person (var name:String, var surname: String)
name and surname are always fields in Class Person. Equally?
I just change the way you instantiate the class Person.
Is that right?
I’ve compiled both versions of a class:
The difference is constructors: