Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compile time error

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting some compile time errors .I am using 1.4
can any one help me
Thanks in advance

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first for loop is an empty one

for(;
 
Krishna Latha Grandhi
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi kumar,

As per my knowledge we can only place the labels just before loops.

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we can only place the labels just before loop



Just Comment out the inside of switch loop and try...it doesnt give any compile time error





Regards
 
Krishna Latha Grandhi
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi kumar,

We can place labels before any statment. But we can able to jump to outside of the loop by identifying the loop with label.

goto like jumps is not possible in java.


The outer label should appear just before the loop begins. It does not
matter if it is on the same line or not.
From K&B book


Hope u understood

Regards
krishna
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Krishna ..Got it..

 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this something specifically do do with SCJP? If not, please consider posting such topics in our Java In General forums. Just because you are studying for SCJP it does not mean you should post every Java issue you have in this forum.
Thanks
-Barry
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic