java.lang.VerifyError on method that worked a minute ago

前端 未结 7 1841

Apologies in advance but I have never seen this error before and don\'t know what to include. I am using NetBeans and suddenly began getting this error:

Exc         


        
7条回答
  •  青春惊慌失措
    2021-01-18 05:02

    I opine it may be caused as a result in class/constructor access specifier mismatch. I just resolved a similar issue where the class was declared with a package access specifier but its constructor was declared public.

    Simply making the constructor also have a package access specifier resolved the issue.

    class Ngram{
    
        public Ngram(String str, int count){
            ngram = str;
            freq = count;
        }
    
        String ngram;
        int freq;
    }
    

提交回复
热议问题