This week's book giveaway is in the
We're giving away four copies of
and have Sam Newman on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Java in General
Compile time unreachability
Joined: May 25, 2005
May 25, 2005 15:27:00
public static void main(
o/p on compiling - unreachable statement int a=1;
But if we replace the || by |, it works fine? How does it work?
Joined: Apr 25, 2005
May 25, 2005 18:25:00
Imagine the code is running. What will the while condition evaluate to? If you enter the loop, what happens next?
SCJP<br />SCJD - someday!
Joined: Aug 03, 2004
May 26, 2005 03:23:00
I get the error with | too. According to JLS both | and || versions should not compile. Both (false || true) and (false|true) are compile time constant expressions with value of true.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Compile time unreachability
3D array Figure
Trouble Printing with java 1.4!
Sorting Array of Strings
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015