Java 21 Not compiling

Revision en1, by rainbowtable, 2023-10-02 11:17:39

Now , we can sumbit in java 21 on codeforces and the most charming feature of java 21 is now we don't need to write public static

before java 21

public class Main{
	public static void main(String[] args){
		System.out.println(5);
	}
}

java 21

void main(){
	System.out.println(5);
}

but on codeforces , I am unable to compile this code and getting this error

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

This is working fine locally but not on codeforces please fix it MikeMirzayanov

Tags java, bug, compilation

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English rainbowtable 2023-10-02 11:17:39 719 Initial revision (published)