I am using generics in java, and I want to know how I can test to see if I have a int or a float? Is there some sort of type-testing? I'm sure there is, I just need someone to help point me in the right direction. Thanks!
paradox814
1
Posting Whiz
Recommended Answers
Jump to Posthuh?
What are you trying to do?
If you have to worry about the exact type of a genericised argument to a method the decision to use generics at that stage was wrong.
Jump to PostThe question still makes no sense. You can't generically pass a primitive as a parameter, so you would need separate signature for each anyway, which alleviates the ambiguity.
All 6 Replies
jwenting
1,889
duckman
Team Colleague
paradox814
1
Posting Whiz
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
paradox814
1
Posting Whiz
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
jwenting
1,889
duckman
Team Colleague
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.