0

Consider the following steps than I've taken:

  1. I created a new java project, named 'A' in my eclipse work space.
  2. I created a new class named 'Class1' and mentioned no package name for it. So it was created in the default package.
  3. I created a new package named 'somepackage' and created a new class named 'class2' in this package.

Now I need to import class1 in class2, and use its features and services. But whatever I do I can't do this. What is the way to overcome this problem?

Sumit Singh
  • 24,095
  • 8
  • 74
  • 100
Narges
  • 29
  • 2

1 Answers1

1

You have to put your Class1 in a package other than default package in order to import it or you can use reflection to use it from default package.

Sanjeev
  • 9,798
  • 2
  • 20
  • 33