المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : about static keyword.



C# Programming
07-21-2011, 05:00 AM
why i can not call a static function with the object of the class. I mean if i write
public class sexp{public static int s;public void count(){s++;}public class int disp(){return s;}}class static{public static void main(string [] args){sexp s=new sexp();s.count();console.write("{0}",sexp.disp());console.readline();}}Why i cannot write "s.disp() insteed of sexp.disp()??????????