non-static method UnionParent(int[],int,int) cannot be referenced from a static context
각 메서드는 다른 메모리에 선언됨으로 인한 호출 불가가 원인이였다.
메서드 생성 위치
- static : 정적 메모리
- non-static : 스택
위와 같이 keword 별로 서로 다른 메모리에 할당되므로 같은 메모리 안에서 생성될 수 있게 해줘야한다.
public static void UnionParent(int[] parent, int a, int b) {
불러오고자 하는 함수에 static을 붙여주었다.