This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Creation of object

 
Ranch Hand
Posts: 57
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to create object of class A which is in package pkj3 from package pkj2.  class B
 
Ranch Hand
Posts: 1332
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if I got it.

Do you mean create Class A which is in package pkj3? Which is within pkj2 which contains Class B?

So pkj3 contains Class A and pkj2 (which contains Class B)?
 
sohail hussain
Ranch Hand
Posts: 57
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Angus Ferguson wrote:I am not sure if I got it.

Do you mean create Class A which is in package pkj3? Which is within pkj2 which contains Class B?

So pkj3 contains Class A and pkj2 (which contains Class B)?

class A in package pkj3 and class B in package pkj2 and both packages are different no sub package
 
Sheriff
Posts: 6107
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using an import statement.
 
Angus Ferguson
Ranch Hand
Posts: 1332
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that should work from Class B
 
sohail hussain
Ranch Hand
Posts: 57
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Angus Ferguson wrote:Yes that should work from Class B

I tried but error is given like this not statment
 
Rancher
Posts: 4174
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might need to show some code, and include the full error message.
 
Angus Ferguson
Ranch Hand
Posts: 1332
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes please, could we see the code and error?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!