John  Burns

John Burns

  • NA
  • 120
  • 109.3k

bugs in code but cant see where

Dec 15 2010 1:25 PM
i bought a book on C# by Head First .. and there is SO MUCH bugs, i have 15 errors. I have checked the errata as well for this but this is not listed.
i created a class called Talker  as the book shown and have went through te code with a bone comb, here it is:

namespace WindowsFormsApplication1
{
    class Talker
    {
        public static int BlaBlaBla(string thingToSay, int numberOfTimes);
        string finalString = "";
  for (int count =1; count <= numberoftimes; count++)
    {
        finalstring = finalstring + thingtosay + "\n";
    }
    MessageBox.Show(finalstring);
    return finalstring.Length;

    }
}


 i have lots of them saying "invalid token in class"


thanks

Answers (7)