Skip to main content

Posts

Featured

Wrapper class

In Java, a wrapper class provides a mechanism to convert primitive data types into objects and vice versa.  Primitive data types like  int ,  char ,  float , and  boolean  are not objects and cannot be used in contexts that require objects, such as Java Collections Framework (e.g.,  ArrayList ,  HashMap ) or with generics.  Wrapper classes address this limitation by "wrapping" the primitive value within an object. Key aspects of wrapper classes in Java: Primitive to Object Conversion (Autoboxing):   Wrapper classes allow you to convert a primitive value into an object of its corresponding wrapper class.  For example, an  int  can be converted to an  Integer  object.  Since J2SE 5.0, this conversion happens automatically through a feature called autoboxing. Java int primitiveInt = 10 ; Integer wrapperInt = primitiveInt; // Autoboxing: int to Integer object Object to Primitive Conversion (Unboxing): ...

Latest posts

Design Patterns in Automation

Difference between Hard Assert and Soft Assert

What is CI/CD and how does test automation fit into the pipeline?

Test Automation Pyramid

What is the Software Development Life Cycle (SDLC) and Software Testing Life Cycle (STLC)?

Handling Flaky Tests

TestNG Execution Hierarchy (Ordered List)

Difference Between HTTP 500 and HTTP 503 Errors 🚨

401 Error

Swapping Two Numbers Without Using a Temporary Variable