File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Working with OOP

 
Robbie Harjes
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok... I want to use Object F in my new class defition. Is it okay/will it work to create a constructor with Object F (having no commands or expressions inside the constructor) so that I can have Object F available to methods declared in the new class?
Might have to read that again... Here's a little more illustrative approach:
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm willing to help u out in your problem, but I found a little difficult in reading your explanation on your problem... Could u please explain it more clearly so that I can help you to solve your problem....
 
Robbie Harjes
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know exactly what to say...
Having a constructor, (with objects that I want "imported" so I can use them in the other methods of the class), that has no expressions or anything inside of it; it's sole existance is to "import" some other object..
I'm pretty sure it'll work, (I mean I could just skip this, and take the object as a parameter for each and every method, but that seems a little wasteful).
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Robbie,
It sounds like what you're trying to figure out is how to innitialize a member variable in a constructor, something like

Here the constructor parameter "theName" is made available to all the methods of the class by storing its value in the member variable "name". Make sense?
[ December 17, 2003: Message edited by: Ernest Friedman-Hill ]
 
Robbie Harjes
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I couldn't just:

?
I understand [/understood] all that, but I guess I was just wondering if I could get around it with less code... Thanks for the help!
[ December 18, 2003: Message edited by: Robbie Harjes ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic