answersLogoWhite

0

someObject myObjectArray[5];

...or...

someObject *myObjectPointer = new someObject[5];

...then...

myObjectArray[2].method();

...or...

(myObjectPointer+2)->method();

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

You can use a variable to declare an array's size true or false?

True and false in the same time, because even so you can declare array size using notation for variables you have use constwhich makes your variable basically a constant:const int arraySize = 10;In Java, you can use any expression to define the array size, when you create the array. Once you create an Array object, however, you can't redimension it - but you can create a new Array object and destroy the old one.


How do you declare an array of buttons in Java?

To declare an array of buttons in Java, you would use the following syntax: Button[] buttonArray = new Button[n]; where n is the number of buttons you want in the array. This creates an array of n buttons, where each element can hold a reference to a Button object.


Can Array List in java hold different data types?

No, we cant hold different data types in an Array. But using Array List we can hold any data type as a Object. But you need iterate that values as a Object and again you need to convert those values into the different data types accordingly.


How do you use character in c plus plus?

If you are referring to the character object 'char,' then here are a couple of uses:To create an object, use this:char object = 'a';To create an array of chars, use this:char array[10];To dynamically allocate an array of chars, use this:char array = new char[10];(Don't forget to delete the object with 'delete [] array')


How many data types can the elements of an array have?

Depends on your language. Assuming java: If you make it an Object[] then it can contain any object For primitive types you must either make a primitive type array, ie double[], char[] which can contain only those primitives, or creater an Object[] and use primitive wrapper objects ie java.lang.Integer etc.


Create an array of 10 elements in java?

to create a new Java array use typeName[] arrayName = new typeName[10]; This gives an array with 10 elements. To set the elements you can use arrayName[index] = value; Remember that the index number starts at 0, so the array will only go to index 9. You can also declare the contents when the array is created typeName[] arrayName = {value1, vaue2, ...} The values used in the array must be objects. In java 5+ you can use primitive types with no concern due to auto-boxing.


How delete an array of object within the object in C?

First locate the position of an array by search after than use a delete function to delete an array


How do you declare an array in easytrieve?

your wish


Why object array called universal array?

Object array is called universal array because it can store multiple variables of the same type


What is the difference between array and string of array?

When we declare an array of characters it has to be terminated by the NULL , but termination by NULL in case of string is automatic.


Why might one need a sting array object in Java?

One might need a sting array object in Java to use protective measures on one's computer to prevent one's program from writing outside the bounds of the array.


How many structure variables of a given type can you use in a C program?

You can use unlimited number of variables for a structure and you can also declare array of structures.