Source should satisfy regex [^{}]*public\s+(final)?\s*class\s+(\w+).*

Revision en1, by parul_bansal, 2016-03-01 19:14:43

I am new in java . I don't know how to debug the error mentioned above in my code . Please help me.

import java.util.*; import java.lang.*; import java.io.*;

class S { public static void main(String args[]){ String s1,s2; Scanner sc = new Scanner(System.in); s1 = sc.nextLine(); s2 = sc.nextLine();

int index=0,sum=0;
    while(index!=-1){

        index = s1.indexOf(s2,index);
        if(index!=-1){
            sum ++;
            index += s2.length();
        }
    }
    System.out.println(sum);
}

}

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English parul_bansal 2016-03-01 19:14:43 703 Initial revision (published)