Winston Gutkowski wrote:I think all programmers should be required to write at least one divide-and-conquer sort in their lives and create a few different types of hashtable from scratch; what I don't expect (and would probably mark them down for) is for them to do it when they're writing a project.
Aditya Jha wrote:You can receive all 4 inputs from user, and then create an Item object and populate its fields. Thereafter, you can add this new Item object to the list.
duhit Choudhary wrote:
Winston Gutkowski wrote:Actually, if Nakataa wants to return a List with a generic runtime type, it is. The problem as I see it, is how to determine what that is. Specifically:
context.getBean(beanName)
needs to be runtime castable to a List<T>, and the only way I can see of ensuring that is to pass the Class, as was mentioned above.
Winston
Matthew Brown wrote:But with the class argument, you don't need to cast. It's compile-time type safe.
The class argument is there simply to specify T because it can't be derived from other arguments.
Steve Luke wrote:But there is still a problem here - the run time has to be able to deduce the type of T at run-time, and must be able to do so from something in the method signature. One way of doing this might be to pass in the Class Object for the type you want.
Seetharaman Venkatasamy wrote:perhaps, main method's argument?
Winston Gutkowski wrote:
Aditya Jha wrote:I'm not sure I'm getting you here. What I proposed was a (possible) solution to point 3 (the rest of my post).
I was referring to your "blindly replace each URL" statement. I don't think that's what Leo had in mind at all.
Winston
Winston Gutkowski wrote:
Aditya Jha wrote:So, let's say you blindly replace each URL with <a href="{0}">{0}</a>.
Actually, I think Leo covered that with his "outside of any tags" statement, but that's what's going to be difficult.![]()
Winston