Effective Java Second Edition

Card Set Information

Author:
nachoburton
ID:
105273
Filename:
Effective Java Second Edition
Updated:
2011-09-29 19:13:54
Tags:
java
Folders:

Description:
Items from the classic book "Effective Java"
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user nachoburton on FreezingBlue Flashcards. What would you like to do?


  1. Item 2
    Consider a builder when faced with many constructor parameters.
  2. Item 1
    Consider static factory methods instead of constructors.
  3. Item 8
    Obey the general contract when overriding equals.
  4. Item 4
    Enforce non-instantiability with a private constructor.
  5. Item 3
    Enforce the singleton property with a private constructor or an enum type
  6. Item 5
    Avoid creating unnecessary objects
  7. Item 6
    Eliminate obsolete object references
  8. Item 7
    Avoid finalizers
  9. Item 9
    Always override hashCode when you override equals
  10. Item 10
    Always override toString
  11. Item 11
    Override clone judiciously
  12. Item 12
    Consider implementing Comparable
  13. Item 13
    Minimize the accessibility of classes and members
  14. Item 14
    In public classes, use accessor methods, not public fields
  15. Item 15
    Minimize mutability
  16. Item 16
    Favor composition over inheritance
  17. Item 17
    Design and document for inheritance or else prohibit it
  18. Item 18
    Prefer interfaces to abstract classes
  19. Item 19
    Use interfaces only to define types
  20. Item 20
    Prefer class hierarchies to tagged classes
  21. Item 21
    Use function objects to represent strategies
  22. Item 22
    Favor static member classes over non-static
  23. Item 23
    Don't use raw types in new code
  24. Item 24
    Eliminate unchecked warnings
  25. Item 25
    Prefer lists to arrays
  26. Item 26
    Favor generic types
  27. Item 27
    Favor generic methods
  28. Item 28
    Use bounded wildcards to increase API flexibility
  29. Item 29
    Consider typesafe heterogeneous containers
  30. Item 30
    Use enums instead of int constants
  31. Item 31
    Use instance fields instead of ordinals
  32. Item 32
    Use EnumSet instead of bit fields
  33. Item 33
    Use EnumMap instead of ordinal indexing
  34. Item 34
    Emulate extensible enums with interfaces
  35. Item 35
    Prefer annotations to naming patterns
  36. Item 36
    Consistently use the Override annotation
  37. Item 37
    Use marker interfaces to define types
  38. Item 38
    Check parameters for validity
  39. Item 39
    Make defensive copies when needed
  40. Item 40
    Design method signatures carefully
  41. Item 41
    Use overloading judiciously
  42. Item 42
    Use varargs judiciously
  43. Item 43
    Return empty arrays or collections, not nulls
  44. Item 44
    Write doc comments for all exposed API elements
  45. Item 45
    Minimize the scope of local variables
  46. Item 46
    Prefer for-each loops to traditional for loops
  47. Item 47
    Know and use the libraries
  48. Item 48
    Avoid float and double if exact answers are required
  49. Item 49
    Prefer primitive types to boxed primitives
  50. Item 50
    Avoid strings where other types are more appropriate
  51. Item 51
    Beware the performance of string concatenation
  52. Item 52
    Refer to objects by their interfaces
  53. Item 53
    Prefer interfaces to reflection
  54. Item 54
    Use native methods judiciously
  55. Item 55
    Optimize judiciously
  56. Item 56
    Adhere to generally accepted naming conventions
  57. Item 57
    Use exceptions only for exceptional conditions
  58. Item 58
    Use checked exceptions for recoverable conditions and runtime exceptions for programming errors
  59. Item 59
    Avoid unnecessary use of checked exceptions
  60. Item 60
    Favor the use of standard exceptions
  61. Item 61
    Throw exceptions appropriate to the abstraction
  62. Item 62
    Document all exceptions thrown by each method
  63. Item 63
    Include failure-capture information in detail messages
  64. Item 64
    Strive for failure atomicity
  65. Item 65
    Don't ignore exceptions
  66. Item 66
    Synchronize access to shared mutable data
  67. Item 67
    Avoid excessive synchronization
  68. Item 68
    Prefer executors and tasks to threads
  69. Item 69
    Prefer concurrency utilities to wait and notify
  70. Item 70
    Document thread safety
  71. Item 71
    Use lazy initialization judiciously
  72. Item 72
    Don't depend on the thread scheduler
  73. Item 73
    Avoid thread groups
  74. Item 74
    Implement Serializable judiciously
  75. Item 75
    Consider using a custom serialized form
  76. Item 76
    Write readObject methods defensively
  77. Item 77
    For instance control, prefer enum types to readResolve
  78. Item 78
    Consider serialization proxies instead of serialized instances

What would you like to do?

Home > Flashcards > Print Preview