File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner class access specifier

 
Siva kandasamy
Ranch Hand
Posts: 139
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There,
I have appended two example below.
example(1) has no issues, works great. Placed here
only as a reference.
May I know, why ? I am unable to compile the code
placed in the example (2).
Error message is also appended inthe bottom of the code. Example (2) has two program ie. InnTestA.java and InnerD.java

Let me know, if you have any questions.
Thanks in advance.
-siva

********* example(2) begins ***********

====file: InnTestA.java ==========

=========File: InnerD.java =============


Compiler error:
==============
~/reading/java % javac InnerD.java
InnerD.java:7: No constructor matching InnTestA. Ica() found in nested class com.siva.simple.InnTestA. Ica.
Ica a = new Ica();
^
1 error
~/reading/java %
********* example(2) ends ***********
[ January 07, 2003: Message edited by: Sivanantham kandan ]
[ January 07, 2003: Message edited by: Sivanantham kandan ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly is the issue you are having? What *exactly* happens when you try to "create" (instanciate?) the inner class?
 
Siva kandasamy
Ranch Hand
Posts: 139
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There,
I did edit and re-posted my question.
Hope it make more sense now.
Thanks
siva
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try recompiling InnTestA.java. I'm guessing you've got an old InnTestA@Ica.class file from an older version of InnTestA.java which had different constructors. To be safe, delete all your .class files and recompile them with javac.
[ January 07, 2003: Message edited by: Jim Yingst ]
 
Siva kandasamy
Ranch Hand
Posts: 139
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still the same problem.
-siva
 
Raj Neets
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello shiva
Try this one, change ur object creation statement like this
InnTestA.ica a = new InnTestA.ica();
Hope this will work.
[ January 08, 2003: Message edited by: Raj Neets ]
 
Siva kandasamy
Ranch Hand
Posts: 139
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks to all.
It works FINE after building a public constructor in the class InnTestA.java as stated below.


-siva
[ January 09, 2003: Message edited by: Sivanantham kandan ]
[ January 09, 2003: Message edited by: Sivanantham kandan ]
[ January 09, 2003: Message edited by: Sivanantham kandan ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic