• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

case???

 
Ranch Hand
Posts: 435
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It means case is reserved word!!
case should be followed by a literal
-Arsho
 
sonir shah
Ranch Hand
Posts: 435
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It means that any reserved key should be followed by a literal orelse it will give a compiler error?
Sonir
 
Arsho, Ayan
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic