Home Uncategorized What is the use of automatic packing and unpacking?

What is the use of automatic packing and unpacking?

by admin

Integer a=1;//This is an automatic packing. If there is no automatic packing, integer a = new integer (1)
int b = a//This is automatic unpacking. If there is no automatic unpacking, you need to do this: int b = a.intvalue()

so you can see that automatic boxing and automatic unpacking simplify the conversion steps of basic data types and corresponding objects

Related Posts

Leave a Comment