Re: Logical OR AND



On Mar 5, 12:44 am, worlman...@xxxxxxxxx wrote:
for the perl statement
$denominator !=0 || ( print "cannot divde 0\n" and next);

I don't recall Java has the similar thing like above, am I right?

Why are you asking a Perl group? Ask a Java group what you can do in
Java.

the above - 2nd part execute only of 1st part is False

you can use logical operator like this?

Yes, obviously you can, since it doesn't give an error.

in Java anything similar??

Again, ask a Java group, not a Perl group.

unless ( $denominator !=0 ){
( print "cannot divde 0\n" and (print "aaa") and next);

}

in perl you can execute several statement in 1 line like above?
( print "cannot divde 0\n" and (print "aaa") and next);

in Java i don't seem to know i can use like above right?

Why all Print statement will evaluate to True ?

The print function is documented in `perldoc -f print`. You should
read it. It explains what the return value of print() is.

Paul Lalli

.



Relevant Pages

  • Re: For performance, fix the Java program
    ... Is it that you don't know enough Java to follow their ... print statement, and following the usual Java pattern of wrapping ... script that fixes those print problems, ... Actually the real problem is the amount of disk space I need to store ...
    (comp.lang.ruby)
  • Re: For performance, fix the Java program
    ... the big bottleneck for Java. ... The Latin squares mini project was ... A couple of days ago single measurements on my machine gave ... print statement, and following the usual Java pattern of wrapping ...
    (comp.lang.ruby)
  • Re: For performance, fix the Java program
    ... Is it that you don't know enough Java to follow their ... Just as I have posted the Ruby and Ocaml version if any ... Which we all know hugely affects performance. ... print statement, and following the usual Java pattern of wrapping ...
    (comp.lang.ruby)