Results 1 to 2 of 2
Thread: Not Static Methods
 04162012, 11:24 PM #1Member
 Join Date
 Apr 2012
 Posts
 1
 Rep Power
 0
Not Static Methods
The methods to be implemented are listed below:
1. boolean find(int x, int[] numbers): If x is an element of numbers, then return true, otherwise return false.
2. int indexOf(int x, int[] numbers): Returns the first location of x in numbers. If x is not an element, return 1.
3. int lastIndexOf(int x, int[] numbers): Returns the last location of x in numbers. If x is not an element, return 1.
4. int elementsGreater(int x, int[] numbers): Returns the number of elements that are strictly greater than x in the numbers array. Returns 0 if no element is greater than x.
5. int elementsSmaller(int x, int[] numbers): Returns the number of elements that are strictly smaller than x in the numbers array. Returns 0 if no element is smaller than x.
6. int elementsEqual(int x, int[] numbers): Returns the number of times x occurs in the numbers array. Returns 0 if x does not occur in numbers.
7. int[] indexOfElementsEqual(int x, int[] numbers): Returns an array containing the indices of the numbers array, which have the value x. For example, if the array is {2, 4, 2, 3, 4, 2}, and x=2, the array returned is {0, 2, 5}. If x is not present in numbers, then null is returned.

Re: Not Static Methods
Let's lock this question as it is nothing but a homework dump which is not appreciated here.
I'm sure that you didn't just dump this in here with the intentions of having someone else do this work for you, and so I invite you to please feel free to reask your question, but if you do, we would appreciate it if you:
 show your current work, and
 ask specific questions about points that confuse you.
If you do this, you will probably find folks bending over backwards to help you.
Best of luck.
Similar Threads

Trouble with static methods and boolean equals() methods with classes
By dreamingofgreen in forum New To JavaReplies: 8Last Post: 04162012, 11:00 PM 
difference between static methods and instantce methods?
By venkatch in forum New To JavaReplies: 1Last Post: 10232011, 12:37 PM 
Static and non static class methods question
By silverglade in forum New To JavaReplies: 2Last Post: 05142011, 10:10 PM 
Recursion with static and non static methods
By sh4dyPT in forum New To JavaReplies: 14Last Post: 03272009, 07:56 AM
Bookmarks