en
Joshua Bloch

Effective Java, Third Edition

Berätta för mig när boken läggs till
För att kunna läsa den här boken överför filer i EPUB- eller FB2-format till Bookmate. Hur laddar jag upp en bok?
  • diormuhar citeratför 2 månader sedan
    The toString method should return a concise, useful description of the object
  • diormuhar citeratför 3 månader sedan
    providing a good toString implementation makes your class much more pleasant to use and makes systems using the class easier to debug.
  • diormuhar citeratför 3 månader sedan
    when is it appropriate to override equals? It is when a class has a notion of logical equality that differs from mere object identity and a superclass has not already overridden equals.
  • diormuhar citeratför 4 månader sedan
    The Boolean.valueOf(boolean) method illustrates this technique: it never creates an object. This technique is similar to the Flyweight pattern [Gamma95]. It can greatly improve performance if equivalent objects are requested often, especially if they are expensive to create.
  • diormuhar citerati fjol
    Note that a nonzero-length array is always mutable, so it is wrong for a class to have a public static final array field, or an accessor that returns such a field.
  • diormuhar citerati fjol
    classes with public mutable fields are not generally thread-safe
  • diormuhar citerati fjol
    a method overrides a superclass method, it cannot have a more restrictive access level in the subclass than in the superclass
  • diormuhar citerati fjol
    The rule of thumb is simple: make each class or member as inaccessible as possible.
  • diormuhar citerati fjol
    Use of the relational operators < and > in compareTo methods is verbose and error-prone and no longer recommended.
  • diormuhar citerati fjol
    the equality test imposed by the compareTo method should generally return the same results as the equals method
fb2epub
Dra och släpp dina filer (upp till fem åt gången)