Escolar Documentos
Profissional Documentos
Cultura Documentos
PROGRAMACIN 2
JAVA Referencia Rpida de Estructuras y Sintaxis
Condicional ( IF )
if( <condicin> ) {
<accin 1>;
<accin 2>;
}
else {
<accin 3>;
<accin 4>;
}
Texto:
Nmero:
Lgico:
EMT Informtica - 2
Bucle WHILE
while( <condicin> ) {
<accin 1>;
<accin 2>;
}
Bucle DO
do{
<accin 1>;
<accin 2>;
}
while ( <condicin> );
Bucle FOR
for(int contador = 0;contador < <valor>;contador++){
<accin 1>;
<accin 2>;
}
PROGRAMACIN 2
Aumentar el valor de una variable de tipo nmero en 1
EMT Informtica - 2
System.out.println( <texto> );
System.out.println( <nombre de variable> );
<variable> = <variable> + 1;
<variable>++;
int numero = 0;
Scanner tecladoNum = new Scanner(system.in);
Numero = teclado.nextInt();
teclado.close();