Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Homework help. Counting the number of times an integer occurs in Array Posted by ageofblades on 18 Jan 2010 at 4:26 PM
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.
Report
To ageofblades:homework help Posted by blamethrower on 20 Jan 2010 at 3:52 PM
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.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.