0

In a folder I only have 2 files. Main.java and ArrayQueue.class
Main.java is the following:

class Main{
public static void main(String args[])
{
ArrayQueue s = new ArrayQueue()
}}

But it throws an error stating the following:

C:\Users\Jatin\Documents\NetBeansProjects\JavaApplication3\src\Main2.java:11: cannot access ArrayQueue
bad class file: C:\Users\Jatin\Documents\NetBeansProjects\JavaApplication3\src\ArrayQueue.class
class file has wrong version 50.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
ArrayQueue a = new ArrayQueue();
^
1 error

Please help

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by purijatin
0

Hello,
try this, make the first line of your code be
public class Main(){

If it doesn't solve it let me know asap. We'ill try something else.

0

Sorry job done. That is because ArrayQueue has methods present in Java 1.6 and I was running it using Java 1.5.
Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.