Top "Equals" questions

Refers to Java equals method, indicating whether some object is "equal to" this one.

Java : "xx".equals(variable) better than variable.equals("xx") , TRUE?

I'm reviewing a manual of best practices and recommendation coding java I think is doubtful. Recomendation: String variable; "xx".equals(…

java equals manual
When Should a .NET Class Override Equals()? When Should it Not?

The VS2005 documentation Guidelines for Overloading Equals() and Operator == (C# Programming Guide) states in part Overriding operator == in non-immutable types …

c# equals gethashcode
java Float: == equals compareTo

I have 2 questions. 1) I was told that when comparing two Float or Double data, use compareTo instead of equals. I …

java equals compareto
What sort of equality does the Apache Commons ObjectUtils equals method test for?

I have always understood there to be two types of equality in Java, value equality : uses the .equals() method to …

java equals apache-commons equality apache-commons-lang
How to ensure hashCode() is consistent with equals()?

When overriding the equals() function of java.lang.Object, the javadocs suggest that, it is generally necessary to override the …

java object equals hashcode
Scala: Is there any way to override "not equals" (!=)?

I'm writing a DSL that generates SQL. The syntax for loading a table is: session.activateWhere( _.User.ID == 490 ) This will …

scala overriding equals equals-operator
how to implement a hamcrest matcher

I want to run this line of code: assertThat(contextPin.get(), equalTo(pinPage.getPinObjFromUi())); but I want to print to …

java equals matcher hamcrest
How do I generate equals and hashCode with the CXF xjcplugin

I am trying to generate a Java class containing the methods toString, equals and hashCode from an XSD file. I …

java xsd equals hashcode cxf-xjc-plugin
Java: clean way to automatically throw UnsupportedOperationException when calling hashCode() and equals()?

We've got an OO codebase where in quite a lot of cases hashcode() and equals() simply don't work, mostly for …

java equals design-by-contract
What is JavascriptMVC's assertEqual function?

I'm a total noob to JavascriptMVC so I'm going through the tutorials. But I have to say something that I'm …

javascript jquery equals assert javascriptmvc