PROG 10082 Lecture Notes - Lecture 12: Hierarchical Storage Management, Call Stack, Function Overloading

109 views2 pages

Document Summary

Value types are stored on the stack, and as long as a method is running the value is valid changing a variable has no side effects on a variable if it is part of a single method. The heap is the runtime data area from which memory for all class instances and arrays is allocated. The heap is created on virtual machine start- up. Heap storage for objects is reclaimed by an automatic storage management system (known as a garbage collector); objects are never explicitly deallocated. Primitive type variables are stored on the call stack. To go from integer to int that is autoboxing. Integer intobject=new integer(2);=> integer intobject=2;//triyng to convert 2 to an integer class, it is being autoboxed. Integer [] intarray={1,2,3}; accessing each value of the int array is unboxing from int class to int primitive type public class mytest{ public static void main.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions