How to call a method from another inherited class in c# -


this question has answer here:

i have class , method below

public class wakeup : world {     public void methoda(string)         {             log.writeline("wakeup world");         } } 

and below 1 class , method in trying call "methoda"

public class hello : world {     public void methodb()         {             wakeup p = new wakeup;             p.methoda(string);         } } 

this isn't working. unable call "methoda" inside "methodb"

note : both classed inherited other class called "world"

can suggest me how can achieve ?

create instance of first class inside second 1 correctly, pass string value instead string type in second class method call

 public class wakeup : world     {        public void methoda(string text)            {                log.writeline(text);            }     }  public class hello : world     {         public void methodb()             {                 wakeup p = new wakeup();                 p.methoda("wakeup world");             }     } 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -