UrbanPro

Find the best tutors and institutes for C# .NET

Find Best C# .NET

Please select a Category.

Please select a Locality.

No matching category found.

No matching Locality found.

Outside India?

Search for topics

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

Asked by Last Modified  

.Net/C# .NET

Follow 0
Answer

15 Answers

Please enter your answer

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 Trainer For Marathi, C,C++,C# and Core Java

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

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

Ask a Question

Related Lessons

Facebook Analytics
Assume how the Facebook application will store the millions of customer's record in real-time: facebook = { 'jose': { 'name': 'jose', 'age': 33, 'hobby': , # cricket,football 'mobile': 1111111111, 'email':...

Logeswaran | 03/09/2019

0 0
0

Multi-core CPU utilization using Task Parallel Library in c#
Nowadays, we are using multiple core systems. We must write our .NET applications in such a way that we must utilise the complete computing power of the machine. The parallel task library(TPL) allows...

Ketan Agnihotri | 12/01/2019

0 0
0

Why a function in C# requires "Return type"??
- Basically , a Method is a piece of code used for the re-usability purpose. - Method is of 2 types Function and Procedure - Function is a method which returns a value to the calling place Function...

Raga Deepthi G. | 25/09/2018

0 0
0

Looking for C# .NET ?

Find best C# .NET in your locality on UrbanPro.

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C# .NET Classes?

Find best tutors for C# .NET Classes by posting a requirement.

  • Post a learning requirement
  • Get customized responses
  • Compare and select the best

Looking for C# .NET Classes?

Find best C# .NET Classes in your locality on UrbanPro

Post your learning requirement

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