|
-
Sep 24th, 2006, 01:06 PM
#1
Thread Starter
Lively Member
[RESOLVED] [2.0] Declaring as Object then typecast?
I have an bunch of classes that will have alot of the same methods, some pretty much identical. So, I have an interface that for example has a save method. Now, as a parameter I want to be able to pass different objects.
The way I came up with is:
save(Object obj)
then when I implement it, I typecast obj to whatever object it'll be using in that class. Does this seem logical or am I going about it the wrong way?
Any guidance is appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|