File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 17258

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

Moving to Java In General (Beginner) forum.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: int array