This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
} } Could anyone explain to me the context in which it is invalid. Any explanation is truly appreciated. Thank you.
bill bozeman
Ranch Hand
Joined: Jun 30, 2000
Posts: 1070
posted
0
I believe you can label anything in your program, but you can't use a break or continue with a label unless what immediatly follows the label is a loop for continue and break or a switch statement for break only (not continue). Bill
Ajith Kallambella
Sheriff
Joined: Mar 17, 2000
Posts: 5782
posted
0
Sridevi, which compiler are you using? I cannot compile your program ( Suns' javac ( JDK1.3 ) compiler ). I get an error, as expected, that says " A declaration cannot be labeled" indicating the label1: float f = 1.3f ; statement.
------------------ Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform.
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Sridevi Shrikanth
Ranch Hand
Joined: Jan 11, 2001
Posts: 31
posted
0
JDK 1.1.7. Probably thats why I get the error. Thank you.
natarajan meghanathan
Ranch Hand
Joined: Feb 01, 2001
Posts: 130
posted
0
Sirdevi, I think declarations cannot be labeled. Btw, can anyone tell me where the traps as listed by ajith or somebody else is in the web. TIA.
------------------ Velmurugan Periasamy Sun Certified Java Programmer ---------------------- Study notes for Sun Java Certification http://www.geocities.com/velmurugan_p/
------------------------------------------------------------------------------------<BR>Velmurugan Periasamy<BR>Sun Certified Java Programmer for Java 2 Platform<BR>Sun Certified Web Component Developer for J2EE platform<BR>Sybase Certified EAServer Developer (similar to jCert level 3)<BR>------------------------------------------------------------------------------------<BR>Study notes for Sun Java Certification<BR><A HREF="http://www.geocities.com/velmurugan_p/" TARGET=_blank rel="nofollow">http://www.geocities.com/velmurugan_p/</A><BR>------------------------------------------------------------------------------------