View Single Post
Old 11-17-2009, 09:45 AM   #22 (permalink)
Vorspire
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 23
Posts: 3,163
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

It actually doesn't matter how many of the ';' character there are, it represents a code-escape to the compiler, so having multiple ';' will still compile.

However, not having a ';' as you see, will cause it to throw errors

Here's a tip, if you want to keep your code tidy (when word wrapping is off), whitespace is pretty much completely removed at compile time, so the code below would still compile;

Code:
public class MyClass
{
        public MyClass()
        { }

        public override void ToString()
        {
                return String.Format("Type: {0} | HashCode: {1}",

                           this.GetType().FullName,
                    this.GetHashCode()
                );
        }
}
Which would end up compiling into;

Code:
public class MyClass{public MyClass(){}public override void ToString(){return String.Format("Type: {0} | HashCode: {1:X8}",this.GetType().FullName,this.GetHashCode());}}
__________________
Criticism should not be the cause of anger. -Dominik Seifert

Last edited by Vorspire; 11-17-2009 at 09:51 AM.
Vorspire is offline   Reply With Quote