en
Joshua Bloch

Effective Java, Third Edition

Avise-me quando o livro for adicionado
Para ler este livro carregue o arquivo EPUB ou FB2 no Bookmate. Como carrego um livro?
  • diormufez uma citaçãomês passado
    To recap, there are four different kinds of nested classes, and each has its place. If a nested class needs to be visible outside of a single method or is too long to fit comfortably inside a method, use a member class. If each instance of a member class needs a reference to its enclosing instance, make it nonstatic; otherwise, make it static. Assuming the class belongs inside a method, if you need to create instances from only one location and there is a preexisting type that characterizes the class, make it an anonymous class; otherwise, make it a local class.
  • diormufez uma citaçãomês passado
    In summary, interfaces should be used only to define types. They should not be used merely to export constants.
  • diormufez uma citaçãohá 6 meses
    Default methods are, however, extremely useful for providing standard method implementations when an interface is created, to ease the task of implementing the interface (Item 20).
  • diormufez uma citaçãohá 7 meses
    eliminate the class’s self-use of overridable methods entirely. In doing so, you’ll create a class that is reasonably safe to subclass. Overriding a method will never affect the behavior of any other method.
  • diormufez uma citaçãoano passado
    The toString method should return a concise, useful description of the object
  • diormufez uma citaçãoano passado
    providing a good toString implementation makes your class much more pleasant to use and makes systems using the class easier to debug.
  • diormufez uma citaçãoano passado
    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.
  • diormufez uma citaçãoano passado
    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.
  • diormufez uma citaçãohá 2 anos
    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.
  • diormufez uma citaçãohá 2 anos
    a method overrides a superclass method, it cannot have a more restrictive access level in the subclass than in the superclass
fb2epub
Arraste e solte seus arquivos (não mais do que 5 por vez)