Solved

! in front of a boolean variable

Posted on 2006-06-13
3
232 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Entity Framework 7 43
Diagnostics with Net and Net.Sockets 2 28
Cant save 3D 4 19
Moving code from one TFS branch to another 3 25
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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