dcsimg
<br> How to pass an instance of an private-accessed class into a method</br>
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   PhiDi_TranThi
Posted On:   Friday, August 2, 2002 08:54 AM

1. I wrote a class PUPLIC_A to implement an interface ITF_B that helps me to access to a class CLASS_C which has private access (because I can not access this class directly. 2. In PUPLIC_A, I implement a method ITF_B1(String string, CLASS_C class_C)to do some works for me. 3. I wrote another class in another file to access class PUBLIC_A and call its method ITF_B1. But when I try to create an instance of CLASS_C to pass to ITF_B1 as its second parameter using operator "new". It failed to do so because CLASS_C can not be instantiated or accessed directly. Is there any other ways to do this. Thanks in advance for any help. PhiDi TranThi    More>>


1. I wrote a class PUPLIC_A to implement an interface ITF_B that helps me to access to a class CLASS_C which has private access (because I can not access this class directly.


2. In PUPLIC_A, I implement a method ITF_B1(String string, CLASS_C class_C)to do some works for me.


3. I wrote another class in another file to access class PUBLIC_A and call its method ITF_B1. But when I try to create an instance of CLASS_C to pass to ITF_B1 as its second parameter using operator "new". It failed to do so because CLASS_C can not be instantiated or accessed directly. Is there any other ways to do this.


Thanks in advance for any help.


PhiDi TranThi    <<Less

Re: <br> How to pass an instance of an private-accessed class into a method</br>

Posted By:   eimi_nos  
Posted On:   Friday, August 2, 2002 02:35 PM

Unless a class is an inner class, it must have some non-private constructors. The class can be instantiated by calling one of those constructors.
About | Sitemap | Contact