Tag: Autoboxing

Array vs Arraylist java

Array vs ArrayList java: Array: 1. Size must be defined during initialization itself. 2. Size can not be resized once initialized. int[] myArraySize = new int[10]; //Possible int[] myArray = new int[];¬† // Not possible 3. Size of the array calculated using length. int[] myArr = new int[9];System.out.println("size of the array : "+myArr.length); //prints 9 …

717 total views, no views today


Autoboxing and Unboxing in java

Autoboxing and Unboxing in java: Autoboxing:¬†Converting primitive data type to wrapper class objects. Eg: int to Integer, double to Double, float to Float etc.., Unboxing:¬†Converting wrapper class objects to primitive data types. Eg: Integer to int, Double to double, Float to float etc..,   Autoboxing Example program: import java.util.Vector; public class Autoboxing { public static …

579 total views, no views today