Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

int array

 
kofi ofei
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it compiles but when i run it nothing seems to be happening

class IntArray{
private native int sumArray(int arr[]);
public static void main(String args[]){
IntArray p = new IntArray();
int arr[] = new int [10];
for (int i = 0; i < 10; i++)
arr[i] = i;
int sum = p.sumArray(arr);
System.out.println("sum = " + sum);
}
static {
System.loadLibrary("MyImpOfIntArray");
}
}
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sumArray method doesn't do anything, so nothing will happen.

Moving to Java In General (Beginner) forum.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic