Results 1 to 2 of 2

Thread: array help

  1. #1
    jacks is offline Member
    Join Date
    Dec 2011
    Posts
    1
    Rep Power
    0

    Post 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 03:59 AM. Reason: code tags added

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

    Default Re: array help

    Quote Originally Posted by jacks View Post
    my professor cant teach i need help with this program
    ...
    ...
    i need help plz i don't even know what im writing is right
    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

  1. Replies: 1
    Last Post: 11-13-2011, 12:25 PM
  2. Replies: 0
    Last Post: 05-12-2011, 08:04 PM
  3. Replies: 23
    Last Post: 09-07-2010, 09:12 PM
  4. Replies: 2
    Last Post: 09-06-2010, 02:03 AM
  5. Replies: 1
    Last Post: 03-31-2009, 07:40 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
  •