Ver Mensaje Individual
  #1  
Antiguo 12-10-2008
nemesis nemesis is offline
Miembro
 
Registrado: mar 2007
Ubicación: Puerto Rico
Posts: 21
Reputación: 0
nemesis Va por buen camino
Link Variables

yo tengo este codigo. de que manera puedo usar los valores que ya recogi en leerElementos para organizarlos de forma ascendente? si es posible. e tratado pero no puedo linkearlas con organizarAscendente para usarlo luego en el main.

Código:
import java.io.*;



public class ManejadorDeArreglos 
{

    public static void leerElementos()
    throws IOException
    {
        int elementos = 0, i, input;
         
        BufferedReader in = new BufferedReader( new InputStreamReader( System.in));
        
        System.out.println("Entre cuantos elementos tendra el arreglo: ");
        elementos = Integer.valueOf(in.readLine()).intValue();
        
        int Array[] = new int[elementos];
        
        for(i = 0; i < elementos; i++)
        {
            System.out.println("Entre el elemento "+ i +": ");
            input = Integer.valueOf(in.readLine()).intValue();
            Array[i] = input;
        }    
    }//end leerElementos
    
    public static void organizarAscendente()
    {
        //HERE
    }

    
    public static void main(String args[])
    throws IOException
    {
        BufferedReader in = new BufferedReader( new InputStreamReader( System.in));
        
        ManejadorDeArreglos.leerElementos();

    }
}//end
Responder Con Cita