•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 455,985 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,760 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 397 | Replies: 6
![]() |
| |
•
•
Join Date: Oct 2004
Location: San Francisco, CA
Posts: 338
Reputation:
Rep Power: 5
Solved Threads: 2
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation:
Rep Power: 19
Solved Threads: 200
•
•
Join Date: Oct 2004
Location: San Francisco, CA
Posts: 338
Reputation:
Rep Power: 5
Solved Threads: 2
•
•
Join Date: Oct 2004
Location: San Francisco, CA
Posts: 338
Reputation:
Rep Power: 5
Solved Threads: 2
Yes, and that is a different story. You repeatedly said you were working with int and float, which are not the same thing.
You can use the "instanceof" operator to check the type of an object variable.
(I think you also mean "abstraction" in your original question - not generics, based on the question. Generics are a type parameterization mechanism introduced in Java 1.5)
Last edited by Ezzaral : Dec 3rd, 2007 at 2:44 pm.
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation:
Rep Power: 19
Solved Threads: 200
If your method implementation can work with both integer and floating point numbers, why handle them differently?
If it can't, why use generics to template away the difference in the method signature?
I assume you pass in an argument of type <E extends Number> ?
If it can't, why use generics to template away the difference in the method signature?
I assume you pass in an argument of type <E extends Number> ?
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Another Java Noob :( (Java)
- problem with java.util.Collections (Java)
- Return values from a method by not using return (Java)
- Generics? (Java)
- My Java Dream (Java)
Other Threads in the Java Forum
- Previous Thread: Need help with a method
- Next Thread: ArrayList or Vector ?



Hybrid Mode