The problem is that you have defined your variable InterfaceSample samp and
initialised it to NULL (InterfaceSample samp=null;).  Then you are trying
to use this object which hasn't been created yet!

You probably want:

InterfaceSample samp = new ClassUsingInterfaceSample(); // or whatever to
create the instance of the object
Then you can call samp.getData();
Although I suspect that it will be useless because it hasn't been populated
with anything (unless the constructor has done something).

Where ClassUsingInterfaceSample is defined as:

class ClassUsingInterfaceSample implements InterfaceSample

Hope this helps,

Haydn



                                                                                       
         
                    "Ramesh                                                            
         
                    Nuthalapati"               To:     <[EMAIL PROTECTED]>       
         
                    <ramnuth@rediffmail        cc:     <[EMAIL PROTECTED]>        
         
                    .com>                      Subject:     (ROSE) Interface - 
subsystem        
                    Sent by:                                                           
         
                    owner-rose_forum@ra                                                
         
                    tional.com                                                         
         
                                                                                       
         
                                                                                       
         
                    16/10/2001 11:06                                                   
         
                    Please respond to                                                  
         
                    "Ramesh                                                            
         
                    Nuthalapati"                                                       
         
                                                                                       
         
                                                                                       
         






Hi all

I have an interface. i have implemented this interface in a sub system. so
my class should access the interface methods which are implemented in the
subsystem. when i am trying to call methods

InterfaceSample samp=null;
samp.getData();

when i used this in my class it says "NULL" and is throwing exception.

Please help me in this issue. how do i call methods which are implemeted in
my subsystem through interface.

everything i have kept in a package.


Thanks in advance
Ramesh Nuthalapati.

************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************




--
Haydn Robinson, Software Engineer                         Sophos Anti-Virus
email: [EMAIL PROTECTED]                      http://www.sophos.com
US Support: +1 888 SOPHOS 9                     UK Support: +44 1235 559933

************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages: http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************

Reply via email to