0

hi guys what constructors should i use for this program?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BACKUPEXEFILES
{
    public class cCOPY
    {
        private string _directorypath;
        private string _filename;

        public string directorypath
        {
            get { return _directorypath; }
            set { _directorypath = value; }
        }

        public string filename
        {
            get { return _filename; }
            set { _filename = value; }
        }           
    }
}

Edited by aragmus: n/a

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by k.d.m
0

A default constructor is never a bad idea.
A default constructor never takes argument and could be used to set some field of your class to a default value.
So you could include in your class, for example something like this:

public cCOPY()
{
    _directorypath = "MyDefaultDirPathName";
    // etc. for other fields
}

Hope this helps a bit.

Edited by ddanbe: n/a

0

Constructor that should be selected can't guess using class itself. Choosing of the Constructor vary from the your need.So select it as appropriate.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.