• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Clarification n Innerclass

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

Could someone explain me the working, when the line10&11 commented and line 6&7 are included(in the program) the program works fine.

The error i get (with line10&11 included) & also explain a brief summary of the error.

( tags added - simple really)
[ May 03, 2005: Message edited by: Barry Gaunt ]
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Arun Kumaar:

The error i get (with line10&11 included) & also explain a brief summary of the error.



It has nothing to do with inner classes. In line 11, you are making a call to the Inner() method, which is not allowed. You can't just place code anywhere in a class.

Henry
 
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Arun]: The error i get (with line10&11 included) & also explain a brief summary of the error.

As Henry already mentioned, line 11 is the culprit for the compile-time error, line 10 is perfectly legal.

To eliminate this error, you can try enclosing line 11 with curly braces like this:


Joyce
[ May 02, 2005: Message edited by: Joyce Lee ]
reply
    Bookmark Topic Watch Topic
  • New Topic