wood burning stoves 2.0
The moose likes Beginning Java and the fly likes int array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "int array" Watch "int array" New topic

int array

kofi ofei
Ranch Hand

Joined: May 22, 2005
Posts: 39
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 {
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

sumArray method doesn't do anything, so nothing will happen.

Moving to Java In General (Beginner) forum.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
subject: int array
It's not a secret anymore!