Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Homework help. Counting the number of times an integer occurs in Array

ageofbladesageofblades Posts: 1Member
Hey everyone! I figured I would go ahead and say hello since I am new to the site. Anyway. Here is my question:

1.
Write a method that will find the number of occurrences of a specified integer in an array of integers. Assume that the array is full of valid data.


I am unsure of how to begin this program and have been staring at it for a couple hours trying to get everything worked out but nothing I am doing seems to work.

Any help would be great.

Comments

  • blamethrowerblamethrower Posts: 1Member
    hi there, I'm also learning Java at my school. I may or may not be able to help you with this as I am still a newb, but I'll try.
    First of all, can you make an array? I would start with that. For example...


    I'll make an array and call it 'list'.

    int[] list = new int[10];

    this array is of type int as u can see. I named it 'list' and it has 10 indexes which are 0 through 9.
Sign In or Register to comment.