SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    ********* Articles ArticleBot's Avatar
    Join Date
    Apr 2001
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Article Discussion

    This is an article discussion thread for discussing the SitePoint article, "Object Oriented C# for ASP.NET Developers"

  2. #2
    CaraCola
    SitePoint Community Guest
    When de cola is cara and the cara is cola its the same put caracola or colacara, did you understand it?

  3. #3
    SitePoint Enthusiast echoSwe's Avatar
    Join Date
    Jun 2005
    Location
    Malmö, Sweden.
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error in your code

    Hello

    I was following the tutorial. The code provided doesn't compile.
    (CoconutTree.cs)
    Code:
        public class CoconutTree : Tree
        {
            private int intNuts = 0;
            public int IntNuts
            {
                get
                {
                    return intNuts;
                }
                set
                {
                    if (value < 0) return;
                    intNuts = value;
                }
            }
            public CoconutTree()
                : base()
            {
                intNuts = 0;
            }
            public CoconutTree(int height)
                : base(height)
            {
                intNuts = 0;
            }
            public CoconutTree(int height, int intN)
                : base(height)
            {
                if (intNuts < 0) this.intNuts = 0;
                else this.intNuts = intN;
            }
    use this instead:
    (Tree.cs)
    Code:
    public class Tree
        {
            private static int totalTrees = 0;
            private int height;
            
            public Tree() : this(5)
            {
                //constructor
            }
            public Tree(int h)
            {
                if (h < 0) this.height = 0;
                else this.height = h;
                totalTrees++;
            }

  4. #4
    LT
    SitePoint Community Guest
    This is the best tutorial I have come across. Thanks alot...

  5. #5
    Tim
    SitePoint Community Guest
    wonderfull thank u

  6. #6
    Michael Leach
    SitePoint Community Guest
    I've been programming in C# for 2 years now, and have a good understanding of it, however I read the article just out of curiosity and to take some advice for explaining in simple terms to newbie programmers some examples.

    Excellent tutorial for beginners, wouldn't have put things better myself. Maybe I'd have explained Exception handling with the Coconut picking method instead of using booleans, but then that may well have been overwhelming.

    Anyways, great job.

  7. #7
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very Nice and useful article .
    Thanks a lot.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •