Results 1 to 2 of 2
  1. #1
    twill is offline Member
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Default 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.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default 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 re-ask your question, but if you do, we would appreciate it if you:
    1. show your current work, and
    2. 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

  1. Replies: 8
    Last Post: 04-17-2012, 12:00 AM
  2. Replies: 1
    Last Post: 10-23-2011, 01:37 PM
  3. Static and non static class methods question
    By silverglade in forum New To Java
    Replies: 2
    Last Post: 05-14-2011, 11:10 PM
  4. Recursion with static and non static methods
    By sh4dyPT in forum New To Java
    Replies: 14
    Last Post: 03-27-2009, 07:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •