Codigo Gay
Enviado por chancla8 • 29 de Agosto de 2014 • 866 Palabras (4 Páginas) • 195 Visitas
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package s_9_v9_infoarreglos;
import java.util.*;
/**
*
* @author Alumno 2014
*/
public class S_9_v9_infoarreglos {
/**
* @param args the command line arguments
*/
public static Scanner teclado= new Scanner(System.in);
public static Random aleatorio = new Random();
public static void main(String[] args) {
// TODO code application logic here
double A[];
double A1[];
A1= new double [100000];
boolean A2[];
A2= new boolean [1];
int A3[];
A3= new int [450];
String A4[];
A4= new String[150];
metodoa();
metodob();
}
public static void metodoa(){
double A[];
A= new double [3];
double x;
for(int i=0; i<A.length;i++){
A[i]= i*3;}
x=A[0]+A[1]+A[2];
for (int IDX=0; IDX < A.length; IDX++){
System.out.println("El valor de x es: "+x);
System.out.println("El valor de A[0] es: "+A[0]);
System.out.println("El valor de A[1] es: "+A[1]);
System.out.println("El valor de A[2] es: "+A[2]);
}
System.out.println("El valor de x es: "+x);
for (int IDX=0; IDX < A.length; IDX++){
System.out.println("El valor de A["+IDX+"] es: "+A[IDX]);
}
}
public static void metodob(){
int B[];
B= new int [5];
B[4]=1;
B[B[4]]=2;
for (int IDX=0; IDX < B.length; IDX++){
System.out.println("El valor de B[0] es: "+B[0]);
System.out.println("El valor de B[1] es: "+B[1]);
System.out.println("El valor de B[2] es: "+B[2]);
System.out.println("El valor de B[3] es: "+B[3]);
System.out.println("El valor de B[4]
...