• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reusability question  RSS feed

 
J. Howard
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My specific question is how to create a set of functions that can be used in many projects, that is, have a folder, directory, project, or package where I can put methods and then call them into a class as needed without physically coping them into the caller's source code (import?). Obviously, I am new to Java and would appreciate being directed to any location for further reading. Would also like to learn generally-accepted techniques of programmming in Java. I know this is a broad subject, and I'm not opposed to extensive reading, just need to be pointed to the right palce(s). TIA, John
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Package the reusable code as a jar file.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J. Howard wrote:Would also like to learn generally-accepted techniques of programmming in Java.

By that do you mean coding conventions in Java??
 
J. Howard
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J. Howard wrote:Yes

If the replies above answer your doubts, you can request the topic to be marked as resolved.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J. Howard wrote:My specific question is how to create a set of functions that can be used in many projects...

If they truly are 'functions' (and you might want to look up the definition), then you might want to consider a "utility" class. They are relatively rare in the general scheme of things, but you might find one useful for your own application. Then it's always there when you need it.

Winston
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!