You must Sign In to post a response.
  • Category: .NET

    C# [ Class object creation]

    Hi

    In the below name space i have created a class Test and i have created objtest in another class. I am not getting any properties or methods from that object.

    Can any one help me please ?


    namespace WebApplication1
    {

    public partial class WebForm1
    {
    protected global::System.Web.UI.HtmlControls.HtmlForm form1;
    }

    public class Test
    {
    private int privatevar = 0;
    public int publicvar = 0;

    private int privatemethod()
    {
    return 6+ privatevar;
    }

    public int publicmethod()
    {
    return 6;
    }
    }

    public class UseTest
    {
    Test objtest = new Test();
    objtest.
    }
    }
  • #769805
    Got answer:

    Object accessing keep in a separate method. you can get object methods.


  • Sign In to post your comments