Go! GO! Go!If you want to start to learn Java, you need to:DOWNLOAD JAVA SDKhttp://www.oracle.com/technetwork/java/javase/downloads/index.htmlDOWNLOAD LATEST ECLIPSE VERSIONhttp://www.eclipse.org/downloads/(Download the Eclipse IDE for Java Developers)CONFIGURE ENVIRONMENT VARIABLEShttp://www.java.com/en/download/help/path.xmlOPEN ECLIPSE......and choose a Workspace.Acess File -> New -> Java Project and create a new project.CREATE A CLASSWith the cursor above the src folder, perform a right click and select New -> Class. You can name it HelloWorld or something else.The "trigger" to execute your first program is the main method. Then, write the following content in your class:public class HelloWorld { public static void main(String[] args) { System.out.println("Java imediato"); } }EXECUTE YOUR FIRST AMAZING HELLO WORLDTo finish, above your class content, perform a right click and choose the option Run As -> Java Application. Then you can see your first program in execution. EXAMPLE 1boolean doIt = true;while(doIt){ System.out.println("print me...");}OUTPUTprint me...print me...print me...(...) ...forever... (...)EXAMPLE 2int x = 5;while(x > 0){ System.out.println("X VALUE: " + x); x--; }OUTPUTX VALUE: 5X VALUE: 4X VALUE: 3X VALUE: 2X VALUE: 1EXAMPLE 3int x = 5;while(x > 0){ if(x == 3){ System.out.println("X VALUE: " + x); break; } x--; }OUTPUTX VALUE: 3EXAMPLE 4int x = 5;while(true){ while(x > 0){ System.out.println("Inner WHILE: " + x); break; } System.out.println("Print eternal loop");}OUTPUTPrint eternal loopInner WHILE: 5Print eternal loopInner WHILE: 5Print eternal loopInner WHILE: 5(...) ...forever... (...)EXAMPLE 5int x = 5;LabelWhile:while(true){ while(x > 0){ System.out.println("Inner WHILE: " + x); break LabelWhile; //"please, break the WHILE 'named' LabelWhile" } System.out.println("Would this be a print of a eternal loop?");}OUTPUTInner WHILE: 5EXAMPLE 6int x = 5; LabelWhile:while(true){ while(x > 0){ System.out.println("Inner WHILE: " + x); break LabelWhile; } System.out.println("Print eternal loop");}OUTPUTInner WHILE: 5-----------------------AND WHAT ABOUT DO... WHILE?The DO...WHILE command is almost the same logic of the conventional WHILE, except by the order of 'loop checking'. See the tips below:1) With WHILE, we check the condition first and execute the loop block later. E.g.:while(/**/){}2) With DO...WHILE, we execute the loop block first and check the condition later. E.g.:do{}while(/**/);//don t miss the semi-colon Neste Post vamos aperfeicoar um pouco os nossos conhecimentos sobre o que vimos ate o momento. Entenderemos o motivo do uso do simbolo ";" apos a invocacao de comandos, entenderemos tambem do que se trata um escopo e variaveis locais.PONTO-E-VIRGULA (;) Cada comando deve ser finalizado com ponto-e-virgula (;). Em Posts anteriores ja trabalhamos com mais de um comando, por exemplo:System.out.println(" Primeiro comando ");System.out.println(" Segundo comando ");O mesmo acontece com a criacao de objetos e chamadas a metodos - se voce ainda nao sabe, "println()" e um metodo. Supondo que exista uma classe chamada Porta, onde seus metodos sao abrir() e fechar(), veremos o uso de ponto-e-virgula no final das chamadas:Porta p = new Porta();System.out.println("O metodo abrir() sera chamado");p.abrir();System.out.println("O metodo fechar() sera chamado");p.fechar();E para que nao reste mais duvidas sobre o uso de ponto-e-virgula, este simbolo tambem e usado na declaracao de atributos:public class Porta{boolean estaAberta;String tipoPorta;}ESCOPOUm escopo delimita o "tempo de vida" de uma variavel, seja ela de referencia ou de um tipo primitivo. Esta delimitacao e definida atraves dos simbolos "{" e "}", que sao equivalentes as instrucoes "Begin" e "End", respectivamente, em linguagens