Simple (get; set;) question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nekk1
    New Member
    • Feb 2012
    • 2

    Simple (get; set;) question

    Hello!

    I'm following a simple tutorial for creating a Twitter feed reader.


    It's really simple, and I'm stuck on one thing.
    Apparently, when I'm creating
    Code:
            public class TwitterItem
            {
                public string UserName( get; set; );
                public string Message( get; set; );
                public string ImageSource( get; set; );            
            }
    I get:
    Identifier expected.
    Invalid token ';' in class, struct, or interface member declaration

    for the get; and set; methods. What am I doing wrong?
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    You don't need the semi-colon after the closing curly brace.

    Comment

    • nekk1
      New Member
      • Feb 2012
      • 2

      #3
      Thanks a lot! I'm pretty sleepy at the moment, so I wrote the () brackets instead of {}

      Comment

      • GaryTexmo
        Recognized Expert Top Contributor
        • Jul 2009
        • 1501

        #4
        Oh yea, look at that, they're also round brackets in your post. See? We all miss stuff! :D

        Glad you got it!

        Comment

        Working...