Click to See Complete Forum and Search --> : interface question


February 26th, 2000, 11:33 AM
Hello all,

I'm getting into Java and trying to pick up as much as I can. I have run into an exercise that I just haven't been able to get for myself yet, so I'm looking for help. I'm supposed write a class that implements the following interface:

interface test{
int[] number(int start, int stop, int step);
//Returns an array of the minimum size required with the
//first value of start, and each following value step
// greater than the last value.

Vector arraytoVector(int[] inputArray);
// returns a vector for the integer array
}
}

Can someone help me? I'd really appreciate it.

Thanks in advance,

DJ Gardner

poochi
February 26th, 2000, 04:44 PM
This is how you have to do..



public class TestImpl implements test{
// you have to implement both the functions over here. otherwise
// this class will become an abstract class..

public int[] number( int start , int stop , int step ){
// Do something , and return int array
}

public Vector arrayToVector( int[] inputArray ){
// Do something , and return Vector
}
}