0

I have a class called PointCP2 in a file called design2 and i have package design; at the top of my class PointCP2. In my test class (PC2Test) which is in the same file I have import design2.*; at the top, but I keep getting this error whenever I try to run it?

How can I possibly fix this?

PointCP2Test.java:5: error: package design2 does not exist
import design2.*;
^
PointCP2Test.java:85: error: cannot access PointCP2
  private static PointCP2 getInput() throws IOException
                 ^
  bad class file: ./PointCP2.class
    class file contains wrong class: design2.PointCP2
    Please remove or make sure it appears in the correct subdirectory of the classpath.
MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
uhhh
  • 7
  • 3
  • 2
    I would not have the test class in the same file. I prefer using JUnit; I'd have separate test classes. Post your code; can't tell from what you've provided. – duffymo Sep 29 '19 at 23:23
  • And directory hierarchy, and how you're running it, and from where. – Dave Newton Sep 29 '19 at 23:27

0 Answers0