This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call class from different package?

 
Syskata Mitev
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have two packages: Main and Users, so i wont from package Users to call package Main class Begin. Please sorry for my stupid question but i am beginer in the java flexibility.
 
Deroga Rivera
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could either import the other package or fully qualify your call.
so import user.begin.* and you can get to all your public methods
 
Srinivas Kalvala
Ranch Hand
Posts: 257
Firefox Browser Hibernate Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Use import statements, make sure that the class is public.


Remeber a Clas Can be : Public or Defualt Package access.

If Default it can be accessed only with in same package.

If public you can access out side of package provided that the class is imported.




 
Campbell Ritchie
Sheriff
Pie
Posts: 47258
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Posted by Srinivas Kalvala
Remeber a Clas Can be : Public or Defualt Package access.
You can also have private or protected class access.
 
Syskata Mitev
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot java family.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic