Link to home
Start Free TrialLog in
Avatar of davetough
davetough

asked on

member names cannot be same as their enclosing types

I am following through this tutorial to learn and I am getting an error 'member names cannot be same as their enclosing type'
can you explain how I can correct this?
namespace AddNumbers
{
    public class AddNumbers
    {
        private int _num1;
        private int _num2;
        public int num1
        {
            get
            {
                return _num1;
            }
            set
            {
                _num1 = value;
            }
        }
        public int num2
        {
            get
            {
                return _num2;
            }
            set
            {
                _num2 = value;
            }
        }
        public int AddNumbers(int n1, int n2)
        {
            return n1 + n2;
        }
    
    }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of microbolt
microbolt

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davetough
davetough

ASKER

thank you