Solved

! in front of a boolean variable

Posted on 2006-06-13
3
229 Views
Last Modified: 2010-04-16
Hi Guys,
            What does "!" mean in front of a boolean variable,
eg.

       if (!method.IsPublic)
            {
                return false;
            }


Thank you,
Serge
0
Comment
Question by:Autofreak
  • 2
3 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 16895310
It is to negate it
0
 
LVL 33

Accepted Solution

by:
hongjun earned 20 total points
ID: 16895317
That's

if method.IsPublic is true, then !method.IsPublic will give you false and vice versa
0
 
LVL 35

Assisted Solution

by:mrichmon
mrichmon earned 20 total points
ID: 16895695
Note this does not just apply to boolean variables.  ! means not.  So therefore when you see != it means not equal.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now