Question
what is wrong with my code. what should I do with this kind of error

61 QueueDemo java - Files - RaProjects/one- A Queue Demoava Queueinterface Java inport java.util.LinkedList; import java.util
0 0
Add a comment Improve this question Transcribed image text
Answer #1

the error Could not load main class shows because the class which have main function i.e main class should have same name as the file (prigramm file)

  • for your code it seems your have diffrent file name QueueDemo.java. so make class name same as QueueDemo.

Second error mostly occure when your java virtual machine tries to found the class or method in class path location but its not there for correccting it you should add the desired class file path in classpath so your JVM can import or found the class for use.

  • best solution is to make the new methods in same directory in which the file itself is present will mostly avoid this error.
  • you can also check the class path by
  • java -classpath .; yourjar.jar yourmainclassname : for windows
  • for adding your file path to class path use command
  • java -cp "c:/location/file" yourmainname.java
Add a comment
Know the answer?
Add Answer to:
what is wrong with my code. what should I do with this kind of error 61...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Step 4 Develop a class with only a main method in it: public class QueueDemo {...

    Step 4 Develop a class with only a main method in it: public class QueueDemo { public static void main(String[ ] args) { /*   Inside of this main method do the following: Create a reference to a QueueInterface<String> called myQueue and have it refer to a new object of the ImprovedQueue<String> class           Call the enqueue method on myQueue passing the String value of “A” Call the enqueue method on myQueue passing the String value of “B” Call the...

  • i was able to make sense on the others but this two i need help Name:...

    i was able to make sense on the others but this two i need help Name: ImprovedQueue<T> Access Modifier: public Implements: QueueInterface<T> Instance variables Name: front Access modifier: private Data type: QueueNode<T> Constructors: Name: ImprovedQueue Access modifier: public Parameters: none (default constructor) Task: sets the value of front to null Methods Name: isEmpty Access modifier: public Parameters: none Return type: boolean Task: returns true if the front is equal to null; otherwise return false Name: dequeue                            Access modifier: public Parameters:...

  • use intellij idea main java Step 4 Develop a class with only a main method in...

    use intellij idea main java Step 4 Develop a class with only a main method in it: public class QueueDemot public static void main(String[] args) { Inside of this main method do the following: Create a reference to a Queue Interface<String> called myQueue and have it refer to a new object of the ImprovedQueue<String> class Call the enqueue method on myQueue passing the String value of "A" Call the enqueue method on myQueue passing the String value of "B" Call...

  • Step 1 Develop the following interface: Interface Name: QueueInterface<T> Access Modifier: public Methods Name: isEmpty Access...

    Step 1 Develop the following interface: Interface Name: QueueInterface<T> Access Modifier: public Methods Name: isEmpty Access modifier: public Parameters: none Return type: boolean Name: dequeue Access modifier: public Parameters: none Return type: T (parameterized type) Name: enqueue Access modifier: public Parameters: element (data type T, parameterized type) Return type: void Step 2 Develop the following class: Class Name: QueueNode<T> Access Modifier: public Instance variables Name: info Access modifier: private Data type: T (parameterized type) Name: link Access modifier: private Data...

  • Step 1 Develop the following interface: Interface Name: QueueInterface<T> Access Modifier: public Methods Name: isEmpty Access...

    Step 1 Develop the following interface: Interface Name: QueueInterface<T> Access Modifier: public Methods Name: isEmpty Access modifier: public Parameters: none Return type: boolean Name: dequeue Access modifier: public Parameters: none Return type: T (parameterized type) Name: enqueue Access modifier: public Parameters: element (data type T, parameterized type) Return type: void Step 2 Develop the following class: Class Name: QueueNode<T> Access Modifier: public Instance variables Name: info Access modifier: private Data type: T (parameterized type) Name: link Access modifier: private Data...

  • use intellij idea main java wp the professor. Please make sure to only implement what is...

    use intellij idea main java wp the professor. Please make sure to only implement what is asked for. You may not add any instance variables to any class, though you may create local variables inside of a method to accomplish its task. No other methods should be created other than the ones listed here. Step 1 Develop the following interface: Interface Name: Queue Interface<T> Access Modifier: public Methods Name: isEmpty Access modifier: public Parameters: none Return type: boolean Name: dequeue...

  • Step 1 Develop the following interface: Interface Name: Queue Interface<T> Access Modifier: public Methods Name: isEmpty...

    Step 1 Develop the following interface: Interface Name: Queue Interface<T> Access Modifier: public Methods Name: isEmpty Access modifier: public Parameters: none Return type: boolean Name: dequeue Access modifier: public Parameters: none Return type: T (parameterized type) Name: enqueue Access modifier: public Parameters: element (data type T, parameterized type) Return type: void Step 2 Develop the following class: Class Name: Queue Node<T> Access Modifier: public Instance variables Name: info Access modifier: private Data type: T (parameterized type) Name: link Access modifier:...

  • using: class MyQueue<T> { private java.util.LinkedList<T> list; public MyQueue() { list = new java.util.LinkedList<T>(); } public...

    using: class MyQueue<T> { private java.util.LinkedList<T> list; public MyQueue() { list = new java.util.LinkedList<T>(); } public void enqueue(T data) { list.add(data); } public T dequeue() { return list.remove(0); } public T peek() { return list.get(0); } public int size() { return list.size(); } public boolean isEmpty() { return list.isEmpty(); } } class MyQueueTest { public static void main(String[] args) { MyQueue<Integer> queue = new MyQueue<Integer>(); queue.enqueue(3); queue.enqueue(2); queue.enqueue(7); queue.enqueue(1); while (!queue.isEmpty()) { System.out.println(queue.dequeue()); } } } please solve the following:...

  • Collect/finish the Java code (interface and the complete working classes) from lecture slides for the for...

    Collect/finish the Java code (interface and the complete working classes) from lecture slides for the for the following ADT: 3) Queue ADT that uses an array internally (call it AQueue) Make sure you keep the same method names as in the slides (automatic testing will be performed)! Make sure your classes implement the corresponding interfaces. Put your classes in a package called cse11. Try to make the code robust and try to use generics. The Queue ADT The Queue ADT...

  • How do I correct this error in my code? When it got to the file type...

    How do I correct this error in my code? When it got to the file type I can only go "null" from a certain point and I'm wondering how to correct this error. Also can I get a word document on this coding strategy for this problem? How much of this am I doing correctly? The original problem description: Create a program that provides a listing of all the files in a directory. The program should be a Java application...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT