2
내가 클래스는 스칼라의 생성자에 사용자 정의 로직을 추가
class MyClass(a: Int, b: String) {
//....
}
나는이 생성자에 일부 사용자 지정 로직 (코드)를 추가하려는 경우를 가정 해?
내가 클래스는 스칼라의 생성자에 사용자 정의 로직을 추가
class MyClass(a: Int, b: String) {
//....
}
나는이 생성자에 일부 사용자 지정 로직 (코드)를 추가하려는 경우를 가정 해?
class MyClass(a: Int, b: String) {
// this is the constructor right here
println("Hi, i'm the constructor")
def imAMethod = 1
println("Hi, I'm also part of the constructor down here, the whole class body is")
}