|
Studying for the SCJP and have some syntax question. 1. Right now the following program prints "OHGOD" (as expected). How do I change it so it prints out "0 1 2 3" using the "x" variables defined in the nested classes? code:
Chuu fucked around with this message at 15:07 on Aug 15, 2008 |
# ¿ Aug 15, 2008 14:50 |
|
|
# ¿ May 29, 2024 11:09 |
|
MEAT TREAT posted:That's loving retarded, why would you ever want that. I agree that it's retarded, but a large part of the exam are things that you would never do in real life, but are there to see if you understand the language spec. That example was pretty simple, I could make it more complex to stop you from "cheating," but what I really want to know is how to fully qualify names of shadowed data members. The only way I know how to do it is with "this" but that isn't enough with multiple-nested classes. edit : Actually, if you don't think Anonymous classes are retarded, this sort of thing could happen really easily with Anonymous classes, in that you need a reference to an object that's not the top level or bottom level class. Chuu fucked around with this message at 21:01 on Aug 15, 2008 |
# ¿ Aug 15, 2008 20:45 |
|
Outlaw Programmer posted:This will print out what you want (inside the printStuff() method)...: Thanks a ton. That's the first use of Anonymous classes I've ever seen that actually seemed useful and not incredibly contrived.
|
# ¿ Aug 16, 2008 11:07 |
|
Another syntax question! This time regarding class locks. We have this code: code:
Implementation 1: code:
Implementation 2: code:
Implementation 3: code:
Chuu fucked around with this message at 12:48 on Aug 16, 2008 |
# ¿ Aug 16, 2008 12:34 |
|
Ahh, ok, thanks a lot. I assumed they work the same was as mutexes on *nix. To make sure, so if you have code like: static synchronized void a(){...} static synchronized void b(){...} Any code which has control of the lock and executing a() will block any other threads from running b(), since the class level lock is associated with all static synchronized code in the entire class? Chuu fucked around with this message at 17:20 on Aug 16, 2008 |
# ¿ Aug 16, 2008 17:13 |
|
|
# ¿ May 29, 2024 11:09 |
|
Can someone please tell me what current libraries are considered the best to interact with a SOAP web service? All I need to do is execute one request (although the response is likely to be 40+ gigs so I need to be able to treat it as a stream, and will be MTOM encoded). Hopefully very simple stuff. I don't know the Java ecosystem at all, and considering how old Java is and how old SOAP is there are too many choices and I don't really have the background to filter it. Chuu fucked around with this message at 06:45 on Oct 3, 2014 |
# ¿ Oct 3, 2014 06:39 |