UrbanPro

Learn C# .NET from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How to overload logical operator in C#? It gives one of the paramters should be containing type? Please help.

Asked by Last Modified  

15 Answers

Learn C# .NET

Follow 0
Answer

Please enter your answer

MS SQL SERVER DBA Trainer

Its define by The Bank is a corporate citizen, with resources at its command and benefits which it derives from operating in society in general. It therefore owes a solemn duty to the less fortunate and under-privileged members of the same society. Staff members are encouraged to make their contribution...
read more
Its define by The Bank is a corporate citizen, with resources at its command and benefits which it derives from operating in society in general. It therefore owes a solemn duty to the less fortunate and under-privileged members of the same society. Staff members are encouraged to make their contribution by understanding the aspirations of the public around them and by endeavouring to evolve measures to remove indisputable social and developmental lacunae. read less
Comments

IT Course Training

Following operator overload to the Vector class to implement the AND function: public static bool operator &(Vector v1, Vector v2) { bool v1flag = !((v1.X == 0) && (v1.Y == 0)); bool v2flag = !((v2.X == 0) && (v2.Y == 0)); return v1flag & v2flag; }
Comments

Professional Training Provider (Focus on to clear Basic Concept)

The conditional logical operators cannot be overloaded, but they are evaluated using & and |, which can be overloaded.
Comments

Trainer

overload menas Different functions Diffrenet Parameter and Return types But funation name is same: Ex: Class TestOveload { public Calulator double(int a, int b)' { return a+b; } public Calulator float (int a, int b) { return a/b; } public Calulator int (int a, int b)' { return...
read more
overload menas Different functions Diffrenet Parameter and Return types But funation name is same: Ex: Class TestOveload { public Calulator double(int a, int b)' { return a+b; } public Calulator float (int a, int b) { return a/b; } public Calulator int (int a, int b)' { return a+b; } } read less
Comments

.Net Trainer with 10 Years

The conditional logical operators cannot be overloaded ..
Comments

International Corporate Trainer For dotnet Core ,Angular 2 ,C ,C++ and LPT Marathi for RBI Banking

Logical operators are not overloaded in C#
Comments

Not just a teacher a trainer as well

logical operators can not be overloaded that is limitation i think so
Comments

Working Experience in IT( .net software development)

Which logical operator you want to overload?
Comments

Software Professional (.NET trainer )

Logical operators i.e NOT operator (!), the AND operator (&), the OR operator (|) and the exclusive OR or XOR operator (^) can be directly overloaded in a class. The short-circuit operators (&& and ||) cannot be overloaded directly. However, if the class meets certain conditions the short-circuit operators...
read more
Logical operators i.e NOT operator (!), the AND operator (&), the OR operator (|) and the exclusive OR or XOR operator (^) can be directly overloaded in a class. The short-circuit operators (&& and ||) cannot be overloaded directly. However, if the class meets certain conditions the short-circuit operators are enabled automatically To create an overloaded version of these operators, the syntax is the same as for other binary overloads, except that the return value is generally of the bool type. public static bool operator logical-operator ( op-type operand, op-type2 operand2 ) Example for OR and XOR operators : public static bool operator |(Vector v1, Vector v2) { bool v1flag = !((v1.X == 0) && (v1.Y == 0)); bool v2flag = !((v2.X == 0) && (v2.Y == 0)); return v1flag | v2flag; } public static bool operator ^(Vector v1, Vector v2) { bool v1flag = !((v1.X == 0) && (v1.Y == 0)); bool v2flag = !((v2.X == 0) && (v2.Y == 0)); return v1flag ^ v2flag; } read less
Comments

Software Professional [Tech Lead @ MNC]

Please check following link... https://msdn.microsoft.com/en-us/library/8edha89s.aspx
Comments

View 13 more Answers

Related Questions

what is the different between c# .net and asp.net?
ASP.NET is a designing tool to design Web Forms (You can call it web pages) but C#.NET is programming Language like C/C++ using this you can write operational code. For example if you want to do something...
Androsen

Hello Sir, I have little bit knowledge of C. Can I continue study Asp.net? Please advice..

Ya sure you can learn but need some knowledge on C++ as well but its not that difficult at all.
Mitu
0 0
8
training
I am one of the TOP Trainer of this site with 12+ years of experience with coaching , Author of 14 books , Team leader in company and mentoring on the .NET platform. You can reach me here: shyam.rajput @ gmail . com
Mir

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Understanding Delegate in C# .NET
C# Delegate technique Delegate is one of the fantastic tool & technique in C#.NET. Using deleagte technique the following benefits could be avaialed One can define a method without name (Anonymous...

What Is The Difference In For...Loop And Foreach Loop?
Loop is very important in C# Programing language. Loop is call iteration statement, loops are used for executing the repeated task. 1. For...Loop: The for…loop executes a statement or a block...

Trends in .Net Platform
.NET Framework is a software framework developed by Microsoft. It includes a large class library named Framework Class Library (FCL) and provides language interoperability (each language can use code written...

What Is An Array? Explain Its Type.
Array: Array is a collection of similar type of data in an array varaiable. Array start with Zero Index and maximum length of array is total element - 1. i.e., Suppose n is the length of array, total element...

What are various validator in ASP.NET 2.0 and features common in all validation control in ASP.NET
Control to validate an error message. Are common feature in all the controls.Various validators are requiredfeild validator ,compare validator ,regular expression validator,custom validator,range validator...

Looking for C# .NET ?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C# .NET Classes?

The best tutors for C# .NET Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C# .NET with the Best Tutors

The best Tutors for C# .NET Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more