Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
QuestionMicrosoft sync framework Pin
hadad9-Jun-10 20:37
hadad9-Jun-10 20:37 
Questionhow to recognize the identityfing code in the image Pin
yu-jian9-Jun-10 20:16
yu-jian9-Jun-10 20:16 
QuestionTextureBrush problem Pin
Xmen Real 9-Jun-10 17:41
professional Xmen Real 9-Jun-10 17:41 
AnswerRe: TextureBrush problem Pin
Luc Pattyn9-Jun-10 17:58
sitebuilderLuc Pattyn9-Jun-10 17:58 
GeneralRe: TextureBrush problem Pin
Xmen Real 10-Jun-10 4:31
professional Xmen Real 10-Jun-10 4:31 
QuestionError in printing Pin
future38399-Jun-10 13:45
future38399-Jun-10 13:45 
AnswerRe: Error in printing Pin
Luc Pattyn9-Jun-10 14:04
sitebuilderLuc Pattyn9-Jun-10 14:04 
GeneralRe: Error in printing Pin
future38399-Jun-10 14:20
future38399-Jun-10 14:20 
thx for ur reply, I fixed it up. the problem is I passed some value to base class but when i write it it shows me nothing.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Inheritance_practice
{
    class Person
    {
        protected string _name;
        protected string _family;
        protected int _age;

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        public string Family
        {
            get { return _family; }
            set { _family = value; }
        }

        public int Aage
        {
            get { return _age; }
            set {
                    _age = value;
                    if (value > 100)
                     {
                        throw new ArgumentException(string.Format("Error.... !"));
                      }
                }
        }

        public Person(string name, string family, int age)
        {
            this._name = name;
            this._family = family;
            this._age = age;

        }
        public Person()
        {
        }

        //public override string ToString()
        //{
        //    return string.Format("Name: {0}\nSurname: {1}\nAge: {2}",name, family, age);
        //}
        
        }

    }




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

namespace Inheritance_practice
{
    class Student:Person
    {
        private string _id;
        public string Id
        {
            get { return _id; }
            set { _id = value;}
        }
        public Student(string name, string family, int age, string id)
            : base(name, family, age)
        {
            this._id = id;
        }
        public Student()
        {
        }



        public override string ToString()
        {
            return string.Format("Name: {0}\nSurname: {1}\nAge: {2}\nId: {3}", _name, _family, _age, _id);
                
        }
    }
}



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

namespace Inheritance_practice
{
    class Program
    {
        static void Main(string[] args)
        {
            Person p = new Person("Ali","Moradpour",28);
            Student s = new Student();
            s.Id = "30069802";



            Console.WriteLine(p);
            Console.WriteLine(s);
            Console.ReadKey();
        }
    }
}

GeneralRe: Error in printing Pin
Luc Pattyn9-Jun-10 14:36
sitebuilderLuc Pattyn9-Jun-10 14:36 
QuestionExceptions From Threads Pin
JohnLBevan9-Jun-10 12:03
professionalJohnLBevan9-Jun-10 12:03 
AnswerRe: Exceptions From Threads Pin
Luc Pattyn9-Jun-10 12:52
sitebuilderLuc Pattyn9-Jun-10 12:52 
GeneralRe: Exceptions From Threads Pin
JohnLBevan10-Jun-10 1:52
professionalJohnLBevan10-Jun-10 1:52 
QuestionThreads, Static Fields & Abstract Classes Problem Pin
JohnLBevan9-Jun-10 11:53
professionalJohnLBevan9-Jun-10 11:53 
AnswerRe: Threads, Static Fields & Abstract Classes Problem Pin
Luc Pattyn9-Jun-10 12:43
sitebuilderLuc Pattyn9-Jun-10 12:43 
GeneralRe: Threads, Static Fields & Abstract Classes Problem Pin
JohnLBevan10-Jun-10 0:55
professionalJohnLBevan10-Jun-10 0:55 
GeneralRe: Threads, Static Fields & Abstract Classes Problem Pin
Luc Pattyn10-Jun-10 1:05
sitebuilderLuc Pattyn10-Jun-10 1:05 
Questionmaking auto serial number for each build of project Pin
kasraa000980009-Jun-10 9:47
kasraa000980009-Jun-10 9:47 
AnswerRe: making auto serial number for each build of project Pin
#realJSOP9-Jun-10 10:02
professional#realJSOP9-Jun-10 10:02 
GeneralRe: making auto serial number for each build of project Pin
Jason Vetter9-Jun-10 10:11
Jason Vetter9-Jun-10 10:11 
GeneralRe: making auto serial number for each build of project Pin
#realJSOP9-Jun-10 23:45
professional#realJSOP9-Jun-10 23:45 
AnswerRe: making auto serial number for each build of project Pin
Tony Richards9-Jun-10 10:44
Tony Richards9-Jun-10 10:44 
QuestionHow to build reportviewer using existing dynamic dataset without report wizard Pin
roman_s9-Jun-10 8:24
roman_s9-Jun-10 8:24 
QuestionFor Multilingual Application Pin
Andy Rama9-Jun-10 7:59
Andy Rama9-Jun-10 7:59 
AnswerRe: For Multilingual Application Pin
Dimitri Witkowski9-Jun-10 8:50
Dimitri Witkowski9-Jun-10 8:50 
QuestionRe: For Multilingual Application Pin
Andy Rama10-Jun-10 6:07
Andy Rama10-Jun-10 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.