• Post Reply Bookmark Topic Watch Topic
  • New Topic

using a custom class  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i created a custom class/object that i would like to use in another program.

object - artist.java

program - music.java

in other words, music.java uses the object that i have defined in artist.java. include statements dont seem to work, so how do i get music.java to recognize and use the class in artist.java?
 
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Erik Stagg wrote:
in other words, music.java uses the object that i have defined in artist.java. include statements dont seem to work, so how do i get music.java to recognize and use the class in artist.java?


Java automatically does this -- meaning look for other classes. As long as your class path is setup correctly (and if you are using packages, the files in the correct directories), you should be good to go.

Henry
 
Erik Stagg
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it was working the whole time apparently! thanks anyway lol
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!