Define Garbage Collection.
Garbage Collection is a process that automatically frees the memory of objects that are no longer inuse. There is no specification of a technique for garbage collection. The implementation has been leftto vendors.
Solutions to Chapter Two Questions
What is object-oriented programming? How is it different from the procedure-oriented programming?
Object- oriented programming is a method of implementation in which programs are organized as co-operative collection of objects, each of which represents an instance of some class and whose classesall members of a hierarchy of classes united in inheritance relationships.With procedural programming you are able to combine returning sequences of statements into onesingle place. A procedure call is used to invoke the procedure. After the sequence is processed, flowof control proceeds right after the position where the call was made
How are data and methods organized in an object-oriented program?
In an object-oriented program, a set of variables and functions used to describe an object constitutes a"class".A class defines the structure and behavior (data and method) that will be shared by a set of objects.Each object of a given class contains the structure and behavior defined by the class, as if it werestamped out of a mould in the shape of a class. A class is a logical construct. An object has physicalreality. When you create a class, you will specify the code and data that will constitute that class.Collectively, these elements are called the members of the class. Specifically, the data defined by theclass are referred to as member variables or instance variables. The code that operates on that data isreferred to as member methods or just methods, which define the use of the member variables.
What are unique advantages of an object-oriented programming paradigm?
OOP offers several advantages to both the program designer and the user. The important advantagesare:
: Elimination of redundant code and use of existing classesthrough inheritance. Thus provides economy of expression.
: Programs can be the built from standard working modules.
: Principle of information hiding helps programmer to build secure programs.
: Object in the problem domain can be directly mapped to theobjects in the program.
: Can be easily upgraded from small programs to large programs.Object-oriented systems are also resilient to change and evolve over time in a better way.
: Easy management of software complexity.