answersLogoWhite

0


Best Answer

'0'

Try this:

public static void main(String[] args){

}

The output would be 0 even though you did not initialize any value in the int array.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the default value of the array elements in an integer array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What restriction must be satisfied by all of the data items represented by an array?

An array is a group of related items that share a common name.All these elements are stored consecutively. An array must be declared before its use in the program. Array size must be specified All Array elements must be assigned to any value for assignment the value. Partial initialization of elements of an array is not allowed. Size must be integer constant enclosed within square brackets The name of the array indicates starting address of an array. Each individual element of array is accessed by a subscript.


What is the default value of integer in java?

According to the JLS, the default value of an int is 0. The default value of an object of type Integer is null. Of course, this applies only to class members fields, as local method-level fields must be explicitly assigned a value before use.


Maximum value of an array?

The maximum number of elements will depend on the type of array and the available memory. An array of char requires only 1 byte per element but an array of pointers requires 4 bytes per element (8 bytes on 64-bit systems). Arrays of objects or structures would likely require more memory per element.For all practical purposes, the maximum size is 2,147,483,647 elements, which is the maximum positive range for a 4-byte integer (0x7FFFFFFF). At 1 byte per element, that works out at 2GB.


What happens if a subscript value is negative or higher than the number of elements in an array?

It cannot be part of the array.


How do you access and store the elements of array?

#include<stdio.h> #include<conio.h> int main(void) { int a[10],i;//array declaration clrscr(); printf("\n enter the elements of array"); for(i=0;i<10;i++) scanf("%d",&a[i]); printf("\n the elements you enter into the array"); for(i=0;i<10;i++) printf("%5d",a[i]); getch(); return 0; }


What are the advantages and disadvantages of arrays in c sharp?

Advantages: 1. Can store "n" number of same data types in different indexes 2. Can be accesses using reference. Disadvantage: 1. No boundary check, if the array boundary is crossed run time 2. No facility to increase the size of array in Run time


How do you convert an integer to Boolean array list in java?

You cannot. An Integer is a numeric value whereas a boolean array list is a collection of a number of true or false values. So, you cannot convert either into the other


How you pass array elements to a function?

Passing array elements to a function is achieved by passing the individual elements by reference or by value, just as you would any other variable. However, passing the entire array requires that you pass a pointer-to-pointer to the array along with the dimension(s) of the array.


What advantage are there in defining an array size in term of symbolic constant rather than a fixed integer value?

It may be possible to generalise results to other integer values.


How do you set the null value in array?

Depends on the programming language, some languages may have already initialize an array with null (or the default value of the type), some of them require explicitly assignments by stepping through each element of that array, and assigning them with null. (imperative languages)


When is it better to pass an entire array of data to a function rather than individual elements?

It is better to do this when the function needs to work on the entire array, rather than on individual elements. However, do not pass the array by value; always pass by reference.


How To find a maximum number in a 2D array?

// Pseudocode int findMax( int[][] data ) { // Return if data is empty if( data.length 0 ) { return 0; } int max = data[0][0]; // Iterate through each element in the array for( int r = 0; r < data.length; ++r ) { for( int c = 0; c < data[0].length; ++c ) { // If we find a value greater than the current max, update max if( data[r][c] > max ) { max = data[r][c]; } } } return max; }