MATLAB BUILDER JA 2 Guide de l'utilisateur Page 128

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 292
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 127
1 2 ... 123 124 125 126 127 128 129 130 131 132 133 ... 291 292

Commentaires sur ces manuels

Pas de commentaire