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
Question 3 Using this line: var posneg : array [1..15] of integer; Write a program that calculates the number of negative and positive numbers in the array. Users will


Explain all Java Primitive Data Types? boolean 1-bit. May take on the values true and false only. true and false are describe constants of the language and are not the s

PS1 emulator for android There is an open source app known as psx4droid i want a developer to solve problems and bugs and doing performance improvement to source code to running

How to Loading Images in JAVA? Polygons, ovals, lines and text cover a lot of ground. The residual graphic object you need is an image. Images in Java are bitmapped GIF or JPEG

Develop an ehospital project Project Description: I am preparing ehopsital project.for the requires of hospital in that patient registration and billing module and stores mod

Normal 0 false false false EN-US X-NONE X-NONE


Prepare a Game in Corona (for Android and IOS) Project Description: We are looking to prepare a game for mobile platform similar to Zombie Smasher for iOS and Android. Eve

I want a Script developer who will make script for me and if you can show good works there are bonuses too. Skills required are Facebook Marketing, Java, Javascript, PHP, and Sc