int [ ] a = new int[25];
for ( int i = 0; i < a.length; i++ )
{
// your code goes here
}a[i]=10;
double [ ] a = { 45.2, 13.1, 12.8, 87.4, 99.0, 100.1, 43.8, 2.4 };
for ( int i = 0; i < a.length; i++ )
{
// your code goes here
}if(a[i]>20)
int [ ] a = { 45, 13, 12, 87, 99, 100, 43, 2 };
double average = 0.0;
for ( int i = 0; i < a.length; i++ )
{
// your code goes here
}
// ... and your code continues here{
average+=a[i];
}
System.out.println(average/a.length);
int [ ] a = { 3, 7, 9 };
int [ ] b = { 2, 9, 4 };
int dotProduct = 0;
for ( int i = 0; i < a.length; i++ )
{
// your code goes here
}{
dotProduct+=a[i]*b[i];
}
System.out.println(dotProduct);
a[0] = 3 a[1] = 6 a[2] = 10
int [ ] a = { 3, 6, 10 };
for ( int i = 0; i < a.length; i++ )
{
// your code goes here
}System.out.println(“a[“+i+”] = “+a[i]);
public boolean foo( String [ ] a )
{
// your code goes here
}for ( int i = 0; i < a.length; i++ )
{
if ( a[i].indexOf( "IBM" ) != -1 )
return true;
}
return false;public int foo( int [ ] a )
{
// your code goes here
}int count = 0;
for ( int i = 0; i < a.length; i++ )
{
if ( a[i] % 7 == 0 )
count++;
}
return count;public boolean foo( String [ ] a )
{
// your code goes here
}if ( a.length < 2 ) return false; else if ( a[0].equals( a[1] ) ) return true; else return false;
public boolean [ ] foo(int [ ] a)
{
// your code goes here
}boolean [] temp = new boolean[a.length];
for ( int i = 0; i < a.length; i++ )
{
if ( a[i] != 0 )
temp[i] = true;
}
return temp;