Results 1 to 3 of 3
  1. #1
    Madhatter40 is offline Member
    Join Date
    Jan 2015
    Posts
    11
    Rep Power
    0

    Default Connecting multiple classes in same package

    I have multiple classes in one package and was wondering how to I use one class while in another?
    What I mean is I have one sheet with a class and another sheet with another class. (Separate tabs in Eclipse)
    Sorry for asking such a foolish question, I am new and am struggling to understand some concepts.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Connecting multiple classes in same package

    If the class's definition is on the classpath, there shouldn't be a problem using it.
    What have you tried?
    What problems are you having?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    milovan is offline Senior Member
    Join Date
    Jan 2011
    Location
    Belgrade, Serbia
    Posts
    311
    Rep Power
    10

    Default Re: Connecting multiple classes in same package

    If you, for example, ever used new keyword, that means you have called another class.

    Java Code:
    class SheetOne{
        SheetTwo two = new SheetTwo(); //calling another class (SheetTwo) from first one
        two.toString(); // actual usage of another class in first one
        ...
    }
    note: depending on the type of class, you can even use another class without new keyword.
    If this is not what you ask, please elaborate your question a little more.

Similar Threads

  1. Replies: 3
    Last Post: 03-27-2012, 09:27 AM
  2. Connecting Classes On 2 Computers Question Jtable
    By kevinn205 in forum New To Java
    Replies: 6
    Last Post: 12-13-2011, 06:12 PM
  3. Replies: 4
    Last Post: 02-07-2011, 07:38 PM
  4. Connecting to Multiple Clients in a Chat Program
    By Gregadeaux in forum Networking
    Replies: 0
    Last Post: 12-09-2009, 01:41 AM
  5. get classes of a certain package
    By ashraf shaban in forum New To Java
    Replies: 4
    Last Post: 07-08-2008, 07:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •