런타임에러가생기는 이유를 잘 모르겠습니다

jybyun Reply 9 years 7 weeks ago
Exception in thread "main" java.lang.NullPointerException at java.lang.String.indexOf(String.java:1698) at java.lang.String.indexOf(String.java:1678) at Main.main(Main.java:13) Scanner sc= new Scanner(System.in); int n=sc.nextInt(); String ss[]=new String [n]; sc.nextLine(); for(int i=0;i<n;i++)ss[i]=sc.nextLine();//store test cases String fs[]= longestS(ss[0], ss[1]); for(int i=2;i<n;i++) for(int j=0;j<fs.length;j++) if(ss[i].indexOf(fs[j])==-1)fs[j]=null; 마지막줄이 13번째줄입니다
jybyun Reply 9 years 7 weeks ago
해결하였습니다