|
The other day I was thinking, is there any reason why Java doesn't have return type polymoprhism? I mean like having public String foo() and public int foo() and then the one that gets called depends on what kind of type of return value the caller expects. This works really nicely in languages like Haskell and I see nothing in Java that prevents it form having this feature.
|
# ¿ Apr 30, 2008 14:12 |
|
|
# ¿ May 9, 2024 07:20 |
|
I'm using SAX2 to get some XML over a socket and parse it. I first make a socket and then pass the InputStream from that socket and my DefaultHandler to the parse method. What I'd like to do is to finish parsing once the root XML element has been closed and leave the socket open so I can write something back to it. What's the best way to do this? Basically the parse method never yields control. If I force it to yield control by throwing an exception from, say, my overriden endElement method in my handler, it closes the socket connection, which I don't want it to do.
|
# ¿ Jun 7, 2009 01:56 |
|
Thanks, I passed the output stream to the event handler for the last element and replied from there.
|
# ¿ Jun 8, 2009 20:01 |
|
Capc posted:What's the next logical step? What are some subjects that might be helpful or fun to learn? Otherwise, I'd suggest solving Project Euler problems or just learning about data structures like balanced binary trees, B-trees, tries, hash maps, implementing these is loads of fun. EDIT: Gah, I thought this was the general programming thread. The original point still applies though. hey mom its 420 fucked around with this message at 13:27 on Jun 19, 2009 |
# ¿ Jun 19, 2009 09:25 |