|
-
February 26th, 2000, 12:33 PM
#1
interface question
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
-
February 26th, 2000, 05:44 PM
#2
Re: interface question
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
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|