问题描述:
有JAVA高手帮小弟解释下下面的英文吗?
Object creation & lifetime
One critical issue when working with object is the way are created and destroyed.Each object requires resource,most notably memory,in order to exist.When an abject is no longer needed it must be cleaned up so that these resources are released for reuse.In simple programming situations the question of how an object is cleaned up doesn’t seem too challenging:you create the object,use it for as long as it’s needed,and then it should be destroyed.However,it’s not hard to encounter situations that are more complex.
Suppose,for example,you are designing a system to manage air traffic for an airport.(The same model might also work for managing crates in a warehouse,or a video rental system,or a kennel for boarding pets.) At first it seems simple:make a container for each airplane and place it in the container for each airplane that enters the air-traffic-control zone.For cleanup,simply clean up the appropriate airplane object when a plane leaves the zone.
主要是下面这一段:
But perhaps you have some other system to record data about the planes; perhaps data that doesn’t require such immediate attention as the main controller function.Maybe it’s a record of the flight plans of all the small planes that leave the airport.So you have a second container if it’s a small plane.Then some background process performs operations on the objects in this container during idle moments.
主要是下面飞机例子说明什么不太明白
Object creation & lifetime
One critical issue when working with object is the way are created and destroyed.Each object requires resource,most notably memory,in order to exist.When an abject is no longer needed it must be cleaned up so that these resources are released for reuse.In simple programming situations the question of how an object is cleaned up doesn’t seem too challenging:you create the object,use it for as long as it’s needed,and then it should be destroyed.However,it’s not hard to encounter situations that are more complex.
Suppose,for example,you are designing a system to manage air traffic for an airport.(The same model might also work for managing crates in a warehouse,or a video rental system,or a kennel for boarding pets.) At first it seems simple:make a container for each airplane and place it in the container for each airplane that enters the air-traffic-control zone.For cleanup,simply clean up the appropriate airplane object when a plane leaves the zone.
主要是下面这一段:
But perhaps you have some other system to record data about the planes; perhaps data that doesn’t require such immediate attention as the main controller function.Maybe it’s a record of the flight plans of all the small planes that leave the airport.So you have a second container if it’s a small plane.Then some background process performs operations on the objects in this container during idle moments.
主要是下面飞机例子说明什么不太明白
问题解答:
我来补答展开全文阅读