• 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

Inner class access specifier

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi There,
I did edit and re-posted my question.
Hope it make more sense now.
Thanks
siva
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still the same problem.
-siva
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic