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

Recommended Answers

All 3 Replies

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.

without the '()'. Sorry for the typo

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.