Andreas Auer

Greenhorn
+ Follow
since Jul 18, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andreas Auer

Hi guys,


thanks for explanation and hints...

Regards,
Andreas
Hi Abhijeet,

but on which.

I'm wondering cause I was told that the output will 3. So this invocation has to ensure that run-method will run before doSomething adds 1 and prints out i.
What's the order of execution? Or as we're talking about Threads, What could be the order?

Does this mean that in case of two running threads join() waits for the other one to finish, or what?
What if we have multiple threads???

As you can see, I'm a bit confused...

Thanks in advance,
Andreas
[ August 15, 2008: Message edited by: Andreas Auer ]
Hi guys,

can you please explain, which thread the join-method is referring to?
I couldn't find any information on join() invoked without a reference...


[ August 15, 2008: Message edited by: Bear Bibeault ]
Hi guys,

can someone please explain why there is/should be a different output using:

$java Input
and
$java Input 0

Why is the 2nd argument considered? I can only see 'args[0]' in code.
(As I don't know if I'm allowed to copy the whole question, I'll skip this until someone tells me anything different.

Thanks in Advance,
Andreas
_____________
Update:

class Input {
public static void main(String[] args) {
String s = "-";
try {
doMath(args[0]);
s += "t "; // line 6
}
finally { System.out.println(s += "f "); }
}

public static void doMath(String a) {
int y = 7 / Integer.parseInt(a);
}
}

command-line invocations:
java Input
java Input 0

Answer is "Each invocation produces a different exception."

Why???
[ July 18, 2008: Message edited by: Andreas Auer ]