Imma new java user
i don't know what's the problem on my code
public class Main { public void queueExample() { Queue queue = new LinkedList(); queue.add("item1"); queue.add("item2"); queue.offer("item3"); queue.offer("item4"); System.out.println("remove: " + queue.remove()); System.out.println("element: " + queue.element()); System.out.println("poll: " + queue.poll()); System.out.println("peek: " + queue.peek()); } public static void main (String [] args) { new Main() queueExample(); } }
and the output of this code is
java.lang.NoClassDefFoundError: Main
Exception in thread "main"
Process completed.