// Parent.java
public class Parent {
public class Tuple3<X, Y, Z> {
public final X x;
public final Y y;
public final Z z;
public Tuple3(X x, Y y, Z z) {
this.x = x;
this.y = y;
this.z = z;
}
public X _1() {
return x;
}
public Y _2() {
return y;
}
public Z _3() {
return z;
}
}
....
}
그런 다음 Tuple3<String,String,Boolean>
스칼라 에서 개체 를 인스턴스화하려면 어떻게 작성합니까?
본질적으로 Java에서 수행하는 것과 동일한 방식입니다.
val outer = new Parent
val inner = new outer.Tuple3("hi", "there", true)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다