For Programmers: Free Programming Magazines  


Home > Archive > Cobol > March 2006 > Re: Java compatibility issues (WAS: MF having issues?)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Java compatibility issues (WAS: MF having issues?)
Frank Swarbrick

2006-03-08, 6:55 pm

Richard<riplin@Azonic.co.nz> 03/07/06 2:11 PM >>>
> am not even sure that anyone wants evaluate to be included in Java or
>any other language, it has its own idiom.


Without something similar to COBOL's EVALUATE you must, in Java, do
something like....

if (myString == "one") {
one();
}
else if (myString == "two") {
two();
}
else if (myString == "three") {
three();
}
else {
four();
}

Wouldn't it be nicer to say:
switch (myString) {
case "one":
one();
break;
case "two":
two();
break;
case "three":
three();
break;
default:
four();
break;
}

(Actually, eliminating those silly 'breaks' woul be even nicer, but...)

Of course the above assumes we're comparing the value of the object myString
and not the object itself. I'm now totally as to which does
what...

Frank


---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com