Linked lists-k reverse


What is the Error in My Code?

Output : Compiling failed with exitcode 1, compiler output: prog.cpp:1:1: error: expected unqualified-id before ‘public’ public class LinkedList {

This is the Error shown in the Output Section.

Output : Compiling failed with exitcode 1, compiler output: Info: renaming main source ‘Main.java’ to ‘LinkedList.java’ LinkedList.java:235: error: cannot find symbol Scanner scn = new Scanner(System.in); ^ symbol: class Scanner location: class LinkedList LinkedList.java:235: error: cannot find symbol Scanner scn = new Scanner(System.in); ^ symbol: class Scanner location: class LinkedList

write import java.util.*;
at the beginning of your code on hacker blocks

moreover your logic of manipulating the pointer is not working do a dry run to check…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.