Main.java:2: error: class LinkedList is public, should be declared in a file named LinkedList.java
public class LinkedList {
^
1 error
Error in LinkedList palindrome
@gargayush01 In hackerblocks your first class will always be named as βMainβ. Rename LinkedList as Main in your whole code.
Eg-
import java.util.*;
public class Main{
}