SShubhamintechtenets.hashnode.dev·Jan 16, 2021 · 5 min readLambdas and StreamsIn Java8, some of the things that are added: lambdas, functional interface, method references -> create function objects streams -> processing sequence of data elements Item 42: Prefer lambdas to anonymous class function types: interface/abstract ...00
SShubhamintechtenets.hashnode.dev·Jan 15, 2021 · 4 min readEnums and AnnotationsTwo special-purpose families of reference types: Enums and Annotations. Item 34: Use enums instead of int constants int constants public static final int APPLE_FUJI = 0; Disadvantages: No type safety (other values can be used, even if not present in...00
SShubhamintechtenets.hashnode.dev·Jan 13, 2021 · 7 min readGenericsGenerics has been present since Java 5. They help in maintaining static typing by inserting casts and give error at compile time if inconsistent. They however comes at a price and the chapter aims to assist in using them efficiently. For reference pu...00
SShubhamintechtenets.hashnode.dev·Jan 6, 2021 · 9 min readClasses and Interfaces - Effective JavaItem 15: Minimize the accessibility of classes and members A well-designed component hides the API and the implementation. It communicates only via the API which is called encapsulation. Advantages of encapsulation: decouples the components faster ...00
SShubhamintechtenets.hashnode.dev·Jan 3, 2021 · 6 min readMethods Common to All ObjectsObject is a concrete class, designed primarily for extension. This article would tell you when and how to override the methods. Item 10: Obey the general contract when overriding equals The default behaviour allows an instance to be only equal to its...00