there is problem in java program. I want to send object of a particular class as a parameter to a method in other class dynamically. e.g Suppose there is method named 'insert' in a class 'Daobase' and parameter to this method is object of any class that is i want to send it dynamically. or is there any other way to do this? please help me out, thank you.
pavya133
0
Newbie Poster
Recommended Answers
Jump to PostWhat are you talking about? Send a parameter dynamically? No idea what you mean there.
However, why don't you just make the defintion as follows:
public whatever whateverMethod(Object... arguments) { // whatever }
Now you can pass it as much of anything as you like.
…
Jump to PostI think, masijade, that he wants to call this method:whateverMethod(Object obj) with any kind of object and for the method to do what is necessary every time dynamically. Meaning that I don't think that he intends to check what type of class he is passing in order to do casting.
…
Jump to PostI think, masijade, that he wants to call this method:whateverMethod(Object obj) with any kind of object and for the method to do what is necessary every time dynamically. Meaning that I don't think that he intends to check what type of class he is passing in order to do casting.
…
All 11 Replies
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
bmbvm5
-1
Newbie Poster
Ezzaral
commented:
Stop spamming this request into multiple threads.
-1
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
pavya133
0
Newbie Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
Zork'nPalls
1
Newbie Poster
madhusamala
0
Newbie Poster
pavya133
0
Newbie Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.