0

Okay, so i'm fairly new to package statements and have came across an error that i've spent a pretty long time on.

package commonADTs.Stacks.StackADT;
import commonADTs.Exceptions.*;

public class ArrayStack<E> implements StackADT
{

I'm getting the error that it can't find StackADT, but StackADT is located in the same directory, and works when the package statement isn't present. I'm using jgrasp and my classpath should be correct. Basically I don't know why I'm getting the error that it's not able to find the file when it's in the same directory.

Feek
  • 297
  • 3
  • 15
  • Please show us your package structure. – Sotirios Delimanolis Oct 01 '13 at 23:31
  • C:\Users\Jose\Desktop\CIS202\Assignment 2\Gumez\commonADTs\Stacks\StackADT The error message is "ArrayStack.java:4: error: cannot access StackADT public class ArrayStack implements StackADT ^ bad class file: .\commonADTs\Stacks\StackADT\StackADT.class class file contains wrong class: StackADT Please remove or make sure it appears in the correct subdirectory of the classpath." – Feek Oct 01 '13 at 23:34
  • You can edit your question (see edit button) and add a directory view of your java files. – Sotirios Delimanolis Oct 01 '13 at 23:34
  • are you refering to this? http://puu.sh/4Fjgr.png – Feek Oct 01 '13 at 23:41
  • `StackADT is located in the same directory` The package is a group of classes, so if your current class belongs to `package commonADTs.Stacks;` and StackADT belongs to that same package, then both classes must be `in src/commonADTs/Stacks` Can you add the package/classname of StackADT? – porfiriopartida Oct 01 '13 at 23:43

0 Answers0