Solution for error :- "Source should satisfy regex [^{}]*public\s+(final)?\s*class\s+(\w+).*"

Revision en2, by kugelblitz1162, 2022-01-09 09:41:27

I recently started coding and being a newbie with no experience whatsoever I got stuck in this error "Source should satisfy regex [^{}]*public\s+(final)?\s*class\s+(\w+).*". If you are also facing the same issue, and have no idea what a regex is, here is a solution that worked for me. All you have to do is start with a public class where you have your main method, and then after the public class, all the other class in the file must be defined after it.

for example:

import **** // any imported package

public class .... { // write a main method here

}

class ..... //here you can define other classes used , just make sure it is after the public class { //define the class you wanna use }

P.S — sorry for my poor English, not a native speaker

Tags newbie, submissions, error

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English kugelblitz1162 2022-01-09 09:41:27 4
en1 English kugelblitz1162 2022-01-09 09:40:39 929 Initial revision (published)