Ejemplo 1: boxeo y unboxing en java
Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. For example, converting an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this is called unboxing.
Ejemplo 2: autoboxing y unboxing en java
Assigning a value of one type to a variable of another type is
known as Type Casting.
Auto-boxing; is a process when you take a primitive value and
assign into wrapper class object.
Un-boxing; is a process when you take Wrapper class object
and convert to primitive.
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)