Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
502 views

Consider this Minimal Reproducible Example. Point point1 = new Point(1, 2, 3); Point point2 = new Point(1, 2, 31); Console.WriteLine(point1 == point2); // True Console.WriteLine(point1.Equals(point2)...
FluidMechanics Potential Flows's user avatar
0 votes
1 answer
180 views

Class gridTradingState Implements IEquatable(Of gridTradingState) Public Overrides Function Equals(other As gridTradingState) As Boolean Implements IEquatable(Of gridTradingState).Equals ...
user4951's user avatar
  • 33.3k
-1 votes
1 answer
79 views

I'm trying to print draw if players and computer choose the same variable, It can not printing if both statements are the same at the moment it just ends after the computers choice and ignores the ...
Oran Kelly's user avatar
0 votes
1 answer
719 views

If 2 variables of the type "object", which are Int32 and Int64, are compared, "true" is displayed in Visual Studio. If I save this in a variable, it suddenly changes to "false&...
syven's user avatar
  • 1
25 votes
1 answer
21k views

I've been seeing statements like this a lot: int? a = 5; //...other code a ??= 10; What does the ??= mean in the second line? I've seen ?? used for null coalescing before, but I've never seen it ...
LCIII's user avatar
  • 3,804
0 votes
3 answers
244 views

Due to my current understanding of Python's syntax, I have run into an issue where I need to set a variable to a value but without using any operators. I have to use functions. Consider this senario ...
KNOB Personal's user avatar
0 votes
0 answers
65 views

My task was to create a list of flights using ArrayList. I've created a Main class, a Flight class and FlightDatabase class,and in FlightDatabase I've added a few new Flights with departure and array ...
putonsky's user avatar
4 votes
2 answers
365 views

If we use the == operator between an expression of ulong and an expression of ulong?, then the operator overload bool ulong(ulong left, ulong right) appears to be used. In other words, the operator ...
Timo's user avatar
  • 8,863
-5 votes
2 answers
250 views

I know that .equals methods from the Object class in Java compares the content of the object but what does it do in the below code and why is it FALSE as i put in the comment line? Please let me know. ...
KarthikPon's user avatar
22 votes
2 answers
2k views

When searching for explanations of how logical equals == works in Java the answers are always something along the lines of: For primitives it returns whether the primitives have the same value (this ...
user7382368's user avatar
1 vote
0 answers
44 views

I was studying basics of java and saw equals() method and wrote this code public class EqualsTest { public static void main(String[] args) { String str = new String("this"); String str2 = new ...
Andy Min's user avatar
3 votes
1 answer
70 views

If I try to compare two objects in javascript using triple equals, object1 === object2 It checked both, type and value. My question is, which one is tested first? type or value?
Shams Nahid's user avatar
  • 6,569
7 votes
2 answers
220 views

If I open my browser console (tested in Chrome/Firefox) and type: null == {} I get: false However, if I commute both arguments to the == operator and instead type: {} == null I get: Uncaught ...
Paul Benn's user avatar
  • 2,041
0 votes
0 answers
56 views

According to the Python 3 documentation, objects that compare equal should have the same hash value. However, it is not uncommon to have two different mutable objects that at a given time can be ...
Tomás Teijeiro's user avatar
0 votes
3 answers
300 views

I'm trying to compare two arrays to see if they are sorted or not. What is the difference between array_diff_assoc and comparing two arrays with the === operator? Are they the same thing? For example ...
Andrea's user avatar
  • 164
0 votes
1 answer
55 views

I am reading a text file using python. Each line will be read if the first character does not equal to # or @. The content of the text is pasted in the end. This works: if line[0] != '#' and line[0] ...
lanselibai's user avatar
  • 1,283
1 vote
1 answer
262 views

I have a dataframe with values new_df.values arr = np.array([[ 0. , 0.31652875, 0.05650486, 0.11726623, 0.30987541, 0.30987541, 0.30987541], [ 0.31652875, 0. , 0.34982559,...
Bharath M Shetty's user avatar
-1 votes
1 answer
139 views

I've got a class using an std::vector> to indicate the item and its count (there can be multiple inventoryitems containing the same item). I then proceeded to overload the clsInventoryItem its == ...
Joey van Gangelen's user avatar
0 votes
2 answers
903 views

int a=40,b=34; int *iptr1,*iptr2; iptr1 = &a; iptr2 = &b; printf("\n Equal condition of two pointers=%d", (ip1 == ip2)); //no error char name1[20], name2[...
Pragati Gupta's user avatar
2 votes
2 answers
4k views

(actual question at the end) Hello World! I've got some disturbing thing happening here that I cannot wrap my head around... Laszy as I am, I hate re-implementing the stupid euqals() emthods over ...
JayC667's user avatar
  • 2,660
0 votes
2 answers
755 views

Let me start off by saying I understand the difference between =, ==, and ===. The first is used to assign the right-hand value to the left-hand variable, the second is used to compare the ...
sab669's user avatar
  • 4,144
0 votes
5 answers
110 views

I am using if condition in jquery and == is not working for me nor === . :( Here is my code: var hash = window.location.hash; var hash = hash.replace('#', ' '); alert(hash); /* Returns abc.*/ if( ...
Danish Ali Malik's user avatar
1 vote
1 answer
38 views

I don't know what is calling my Equals method, because when the breakpoint is hit there is no call stack (except the Equals itself and [External Code]). I have a class UserComplete that has methods ...
Gary's user avatar
  • 3,314
0 votes
0 answers
28 views

I am trying to write a generic equality comparer. I've written the following code. public static bool Equals<T>(T t1, T t2) { bool result; if (typeof(T).IsPrimitive) { ...
Nuri Tasdemir's user avatar
0 votes
0 answers
23 views

Lets take two arrays var apple = [1,2,3]; var bracket = [1,2,3]; and a string cat here with the same contents as the initial 2 arrays with no difference except comma (,) var cat = "1,2,3"; Now lets ...
SaiKiran's user avatar
  • 6,534