• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to compile with Interface in different package  RSS feed

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I have an interface in one package and using it in another class present in another package. but not able to import it.





Please assist
 
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have an interface in package: first.second But you are importing- first.second.third.A?
 
Pravin Jagan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops my mistake.
Actually it is like given below . Please suggest

 
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Other than your A.method() signature not ending with a semicolon (another typo?), the architecture you've outlined should work. Try putting A in the same package to see if that makes a difference.

What error message are you getting?
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless. Remember that it is important to tell the details. Please tell us the error that you are getting. Otherwise people won't be able to help
 
Pravin Jagan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Issue was the identifier
the interface had default access, hence it was not visible in another package

thanks, everybody
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pravin Jagan wrote:Issue was the identifier
the interface had default access, hence it was not visible in another package

thanks, everybody


How did it have default access? Its declared as public?
 
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pravan, I am glad you solved your programming problem. But the moral of this story is PostRealCode. You had at least three differences in your posted code which made solving your problem impossible.
 
Pravin Jagan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apologies folks. my bad.
will take care in future
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!