aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Clarification n Innerclass Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Clarification n Innerclass" Watch "Clarification n Innerclass" New topic
Author

Clarification n Innerclass

Arun Kumaar
Greenhorn

Joined: Oct 22, 2004
Posts: 20

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 ]

If I could melt your heart<br />We'd never be apart<br /> <br />Frozen --- Madonna
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19004
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Joyce Lee
Ranch Hand

Joined: Jul 11, 2003
Posts: 1392
[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 ]
 
jQuery in Action, 2nd edition
 
subject: Clarification n Innerclass