Generics is one of the best things that happened to Java. Anyone who has worked with Java during its pre-JDK5 era can attest to that. For new developments, it has drastically reduced the amount of written codes and provided compile-time type checking using Generic Types. However, there are some things you cannot do with Generics Types.
Rust Generics With Structs, Functions, Methods, and Enums
Rust Generics is a language feature for code reuse in multiple contexts using different actual types for Structs, Functions, Methods, and Enums. Moreover, they allow for concise and clean codes by minimizing boilerplates while providing type-safety. When we use Generics,
Clone Objects in Java with Generics using Apache Commons Lang ObjectUtils
This post demonstrates how to clone objects in Java with Generics using Apache Commons Lang ObjectUtils. ObjectUtils [wp_ad_camp_1] ObjectUtils is utility class from Apache Foundation that can be used to clone objects in Java. It is part of a distributable
Java – 3 ways to implement a Generic Interface
A Generic Interface is an interface that makes use of formal type parameters. It uses Generics. There are 3 ways to implement a Generic Interface.
Java Formal Type Parameter Methods We Can Invoke
With Java Generics, we name Java Formal Type Parameter T, E, K, and V conventionally. If an instance of a Format Type Parameter, what available methods we can invoke on them? Java Formal Type Parameter is Object Formal Type Parameters
Function Accepts Struct That Implements A Trait
This post briefly talks about how to create functions that accept struct instances that implement a specific trait.
Vec With Specific Trait Type
In this post, we want to create a Vec instance that only accepts struct instances that implements a particular trait.