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
Make a JavaScript jQuery script to fill variables from a remote JSON file I'm in requirement of someone to write and rewrite some JavaScript code that connects to a remote rest

Create an application for an animal-fur trimming service. The business is open 15 weeks of the year, from April through July. The fee for a small animal (under 6 pounds) is $100, a

hi i wanted to know if your tutors provide solutions for programming assignments

Describe java operators? An operator is a symbol which operates on one or more arguments to generate a result. The Hello World program is so easy it doesn't use any operators,

What is heuristic? Heuristic is a procedure which commonly, but not always, works or that provides nearly the right answer.

Development of an Android app urgent Project Description: I am searching for some good android developer who has depth in knowledge of making an app. I am focusing on a certa

I want somebody to help me to create a program in java that helps me to read data from usb logs in windows Project Description: I want a java program that helps me to detect

It helps to resolve naming conflicts when different packages have classes with the same names. This also helps you prepare files within your project. As define : java.io package d

I am having trouble with the code below because I am trying to call the text field input type so that whenever someone enters a number above 10 it responds with the alert shown bel

What will be the output of this programme? Write comments where you find "//" symbol in the following code? function doSomething() { // 1 setTimeout('doSomething()',10000