Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Lab 10 Lab 10: Additional Look at Stack and Memory Diagrams In this lab, we will look at some more examples to help you understand some concepts related to stack structure and memory usage. You may see similar problems with arrays in the upcoming exam and it is crucial that you understand these concepts well. Here are slides showing some of the memory and stack diagrams we will discuss. 1. Memory Usage and Stack Diagrams We will use Declare.java to see what kind of language constructs in your program causes memory allocation and what kind just uses the memory already allocated without causing any further allocation. We will then, using Stack.java as an example, relate the constructs that cause memory allocation to what you see on the run-time stack, the kind of stack diagrams that have been drawn in class. 2. Parameter Passing and Stack Diagrams We will examine Parameter.java using a stack diagram to show you what the program does. Here again, where a piece of memory gets allocated and what values will be held in that piece of memory for how long will be crucial to understand how a program works with functions that take parameters. 3. Parameter Passing and Stack Diagrams with Arrays We will examine Memory.java using a stack diagram to show you what the program does. Here again, where a piece of memory gets allocated and what values will be held in that piece of memory for how long will be crucial to understand how a program works with functions that take parameters, particularly when it involves an array. 4. Practice On your own or working in pairs, examine StringLab.java and make a memory diagram to show the state of the program at the two commented lines in the code (i.e. make two separate diagrams).