I tried running this program but it didnt compile. The error was as follows: Test003.java:6 : orphaned case case ^ 1 error What do we mean by this? Sonir
Arsho, Ayan
Ranch Hand
Joined: Nov 14, 2001
Posts: 60
posted
0
It means case is reserved word!! case should be followed by a literal -Arsho
sonir shah
Ranch Hand
Joined: Nov 01, 2001
Posts: 435
posted
0
It means that any reserved key should be followed by a literal orelse it will give a compiler error? Sonir
Arsho, Ayan
Ranch Hand
Joined: Nov 14, 2001
Posts: 60
posted
0
Sonir : Use a IDE for writing programs, you will know which to use and which not to. There is a Textpad available freely, which you can write small programs and run it easily. -A
Shivaji Marathe
Ranch Hand
Joined: Jan 11, 2002
Posts: 203
posted
0
Sonir : It means that you can not use reserved words as labels for loops. In general reserved words ( in any programming language) can not be used for any other purpose besides what they are defined as . So you can not write code such as for ( int case =1; case < boolean; case ++) or if ( while > do ) { //some code } HTH
mark stone
Ranch Hand
Joined: Dec 18, 2001
Posts: 417
posted
0
code is fine only change the word case to somthing else like test1 or hello or sing case is a reserved word for the compiler. x=0 y=0 x=1 y=0
Originally posted by sonir shah:
I tried running this program but it didnt compile. The error was as follows: Test003.java:6 : orphaned case case ^ 1 error What do we mean by this? Sonir