The Artima Developer Community
Sponsored Link

Java Answers Forum
Passing a class to a class

2 replies on 1 page. Most recent reply: Apr 23, 2003 3:50 PM by Jaycee

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
Mara Simon

Posts: 2
Nickname: miresi
Registered: Apr, 2003

Passing a class to a class Posted: Apr 20, 2003 11:40 AM
Reply to this message Reply
Advertisement
My question is how do you pass a handle of a class to a second class so the second class can use the first class. I'm not talking about extending, implementing, super, or parent/child. I want to pass a handle of a class to a class that creates a window and inputs and outputs data from the users. The data should be passed to the first class to process. These classes should be as independant as possible so they can be replaced as needed.

Thanks for reading


Adam Duffy

Posts: 168
Nickname: adamduffy
Registered: Feb, 2003

Re: Passing a class to a class Posted: Apr 23, 2003 3:29 AM
Reply to this message Reply
Just a wild guess here.

public void doSomethingWithClass( Class c )
{
    // get the methods from the class, etc.
}


Something like that? Or have I missed the point?

Adam

Jaycee

Posts: 26
Nickname: jaycee
Registered: Apr, 2003

Re: Passing a class to a class Posted: Apr 23, 2003 3:50 PM
Reply to this message Reply
Do you mean object, or java.lang.Class?

Flat View: This topic has 2 replies on 1 page
Topic: Whats wrong with this code Previous Topic   Next Topic Topic: Javax.comm

Sponsored Links



Google
  Web Artima.com   

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