Results 1 to 2 of 2
Thread: array help
- 12-10-2011, 01:57 AM #1
Member
- Join Date
- Dec 2011
- Posts
- 1
- Rep Power
- 0
array help
my professor cant teach i need help with this program
write a method with parameter of
an int array
the array single
the method should return the index of the smallest integer
write a main program to
enter values into the array
test the method
i need help plz i don't even know what im writing is right
Java Code:import java.util.*; class samp { public static void main(String[] args) { Scanner input = new Scanner(System.in); array arrayObject = new array(); System.out.println("please enter an value: " ); x[i]=input.nextInt(); arrayObject.y(x[i]); } } class array{ static void y(int x[]){ for (int i= 0; i<x.lenght; i++){ System.out.print(x[i]); } } }Last edited by pbrockway2; 12-10-2011 at 02:59 AM. Reason: code tags added
-
Re: array help
You've got to study and learn the basic rudiments before we can even begin to help you, and the best way to learn is to teach yourself. You'll want to start here: The Java Tutorials: The Really Big Index
Much luck.
Similar Threads
-
checking a 2D Array off a 1D Array and outputting result
By leoshiner in forum New To JavaReplies: 1Last Post: 11-13-2011, 11:25 AM -
Display Array on another class after extracting from txt file and into array problem
By jonathan920 in forum NetBeansReplies: 0Last Post: 05-12-2011, 07:04 PM -
Variable of an object in an array compared to an element of another array?
By asmodean in forum New To JavaReplies: 23Last Post: 09-07-2010, 08:12 PM -
Trying to make an array list // inserting an element to middle of array
By javanew in forum New To JavaReplies: 2Last Post: 09-06-2010, 01:03 AM -
How to add an integer to a array element and the store that backinto an array.
By Hannguoi in forum New To JavaReplies: 1Last Post: 03-31-2009, 06:40 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks