Novatadas en java

225 views

Published on

java

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
225
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Novatadas en java

  1. 1. /*System.out.println(""Una nota""); System.out.println("Hola Mundo"); String i ="4"; System.out.println("El valor de i es: "+i); System.out.println(i); int n = 12; char x =w; System.out.println(n); System.out.println("El valor de x es: " + x); double j = 1.0 / 2.0; System.out.print("j es: "); System.out.println(j); int h = 0; int e = 2; while(h <= 10) { System.out.println(++h); if(h != 2 && h != 4 && h%2 == 0) {
  2. 2. break; } } String p = (h == 4)? "Listo":"Fallo"; System.out.println(p); BufferedReader datosEntrantes = new BufferedReader( newInputStreamReader(System.in) ); String nombre = ""; System.out.println("Escribe tu nombre, Por Favor!!"); try { nombre = datosEntrantes.readLine(); } catch (IOException ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); System.out.println("Error!!"); } System.out.println("Hola " + nombre + "!!"); int[] a= new int [10];
  3. 3. a[0] = 7;a[1] = 9;a[2] = 6;a[3] = 3;a[4] = 1;a[5] = 8;a[6] = 2;a[7] = 4;a[8] = 5;a[9] = 0;for(int g =0; g < a.length - 1 ; g++){ System.out.println("La posicion " +(g + 1) +" es igual a ="+ a[g]);}for(int k = 0; k < a.length -1; k++){ int min = k; for(int l = k + 1;l < a.length; l++) {
  4. 4. if(a[l] < a[min]) { min = l; System.out.println("0"); } System.out.println("a"); } if(k != min) { int aux = a[k]; a[k] = a[min]; a[min] = aux; System.out.println("b"); } System.out.println("c");}System.out.println("");for(int m = 0;m < a.length;m++){
  5. 5. System.out.println("La posicion " +(m+1) +" es igual a = "+ a[m]);}*/

×