Purchase Solution

Methods for Allocating Memory for an Array

Not what you're looking for?

Ask Custom Question

Describe some of the methods for allocating memory for an array and describe methods for initializing an array. Please include example code that does this.

Purchase this Solution

Solution Summary

Methods for allocating memory for an array and describe methods for initializing an array are featured.

Solution Preview

In Java, an array variable is declared the same way that any Java variable is declared. It has a type and a valid Java identifier. The type is the type of the elements contained in the array. The [] notation is used to denote that the variable is an array. Some examples:

int[] counts;
String[] names;
int[][] matrix; //this is an array of arrays

Once an array variable has been declared, memory can be allocated to it. This is done with the new operator, which ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Networking Questions

This quiz consists of some basic networking questions.

C# variables and classes

This quiz contains questions about C# classes and variables.