0

I have an external .class file. I added this through:

Right Click to project>BuildPath>Configure Build Path>Libraries>Add External Class Folder

This is my folder structure. I am supposed to create an instance of SOS class. But I got errors in compilation. Where is the problem ?

enter image description here

My SOS.class file is located in desktop, inside Classes folder

1 Answer 1

0

Give a package name for SSO class.Compile that and then add it in reference library.

In Test.java write

import your.packge.name.SSO;

avoid using default packages when you want to import classes from them.

2
  • I can't see refactor option for default package :( how will i give it a name
    – funky-nd
    Apr 1, 2015 at 14:35
  • Test is in the default package, so it should be able to reference SOS. It's only if you want to import the class from a class in a non default package that you get issues.
    – Antimony
    Apr 1, 2015 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.