The Artima Developer Community
Sponsored Link

Java Answers Forum
linking a class file into the main java file

2 replies on 1 page. Most recent reply: Dec 12, 2003 2:24 AM by Sunitha C S

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
luke

Posts: 7
Nickname: phillyhus
Registered: Dec, 2003

linking a class file into the main java file Posted: Dec 11, 2003 12:42 PM
Reply to this message Reply
Advertisement
hi i am very new to java and was wondering this simlple question,(well simple for you lot!). i was wondering how i link my four external class files into my main java file application. any help much appreciated. Cheers

Luke


Fay

Posts: 16
Nickname: flyfay
Registered: Sep, 2003

Re: linking a class file into the main java file Posted: Dec 12, 2003 1:02 AM
Reply to this message Reply
Hey,
try to put your four class into a package, then at the beginning of your class, you import this specified package, like import java.io.*; then i guess you can solve your problem. hope my this idea can help you. good luck

cheers
fay

Sunitha C S

Posts: 20
Nickname: sunics
Registered: Dec, 2003

Re: linking a class file into the main java file Posted: Dec 12, 2003 2:24 AM
Reply to this message Reply
Hello,
Its simple if all the class files are in the same directory, and all are public classes, u can simply use the classes in the file as if they are defined in the same file. but if they are in different directories, just set the classpath variable to those directories where they reside and use in the same manner.
sunitha

Flat View: This topic has 2 replies on 1 page
Topic: Execute a batch file from a Java class Previous Topic   Next Topic Topic: JAAS Sun One Directory 5.2

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use