MATLAB BUILDER JA 2 Podręcznik Użytkownika Strona 128

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 127
4 Using MWArra y Classes
equals. This method indicates the MWArray obje ct is equal to the input
object. The
equals method of the MWArray classoverridestheequals method
of class
Object.
The prototype for the
equals m ethod is as follows:
public boolean equals(Object object)
Input Parameters
object
Array to compare this MWArray object to
Example Comparing MWArrays with equals
Create a shared copy of the MWArray object and then compare it to the original
object. A return value of
true indicates that the two o bjects are equal:
Object S = A.sharedCopy();
if (A.equals(S))
System.out.println("Matrix S is equal to matrix A");
When run, the example displays this output:
Matrix S is equal to matrix A
hashCode. This method returns a hash code value for the MWArray object.
The
hashCode method of the MWArray class overrides the hashCode method
of class
Object.
The prototype for the
hashCode method is as follows:
public int hashCode()
Input Parameters
None
4-52
Przeglądanie stron 127
1 2 ... 123 124 125 126 127 128 129 130 131 132 133 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag