본문 바로가기

java

java - No enclosing instance of type Main is accessible.

728x90

No enclosing instance of type Main is accessible. Must qualify the allocation with an enclosing instance of type Main (e.g. x.new A() where x is an instance of Main).


public class Main {


public static void main(String[] args) {

Solution s = new Solution();


}

class Solution {

    public int solution(String numbers) {

        int answer = 0;

        return answer;

    }

}


}




public class Main {


public static void main(String[] args) {

Solution s = new Solution();


}

static class Solution {

    public int solution(String numbers) {

        int answer = 0;

        return answer;

    }

}


}


http://mainia.tistory.com/2675

728x90