Constructors or destructors in java program, JAVA Programming

Consider the following Java definition of an integer list class.
class IntegerList
{
private int[] list = new int[200];
private int size = 0;
public boolean append(int value)
{
if (size == list.length)
return false;
list[size++] = value;
return true;
}
public String toString()
{
String result = "";
for (int i = 0; i < size; i++)
result += list[i] + " ";
return result;
}
}

Suppose this class was rewritten in C++ in two ways, the first with the array that represents the list as a stack-dynamic variable, and then with the list as a heap dynamic variable. Explain when constructors and destructors would be needed. Explain why no constructors or destructors are needed in the Java implementation.

Posted Date: 4/6/2013 5:47:12 AM | Location : United States







Related Discussions:- Constructors or destructors in java program, Assignment Help, Ask Question on Constructors or destructors in java program, Get Answer, Expert's Help, Constructors or destructors in java program Discussions

Write discussion on Constructors or destructors in java program
Your posts are moderated
Related Questions
I am requiring webcam software integrated into my site I have website and I am wanting webcam software integrated into my site the company I have found doesn't offer support in

Explain how several ways businesses monitor their employees? Systems are available in which monitor or most every key stroke which an employee forms on computer. Systems are av

What is an intelligent system? Intelligent system is a SW programs or SW and HW systems designed to perform complex tasks employing strategies in which mimic some aspect of hum

What are the different points where weaving can be applied? Ans) There are three points ? Compile Time ? Classload Time ? Runtime

What are the parts of website design? Parts of web design: There are in 3 types of elements for web design and below are there names: 1. Navigation scheme 2. Overall look and


Question Based on the program fragment below, rewrite the outer for loop using: a. while loop b. repeat..until loop

Java Project Introduction: In this project, you will explore a few sorting algorithms. You will also test their efficiency by both timing how long a given sorting operation take

Talent agencies like ICM, CAA and Paradigm represent writers, directors and actors (among other talent).  These agencies take in hundreds of millions of dollars a year collecting 1