Commit c39e7183c3134fab2a593036463169b97dd3319b
1 parent
0ff46634
Exists in
master
implementacao segundo capitulo
Showing
1 changed file
with
52 additions
and
4 deletions
Show diff stats
src/primeiroprojetojava/Main.java
... | ... | @@ -2,21 +2,69 @@ |
2 | 2 | * To change this license header, choose License Headers in Project Properties. |
3 | 3 | * To change this template file, choose Tools | Templates |
4 | 4 | * and open the template in the editor. |
5 | + * TIPOS PRIMITIVOS | |
6 | + * tipo bits exemplo | |
7 | + * char 16 'a' | |
8 | + * byte 8 000001 | |
9 | + * int 32 1 | |
10 | + * short 16 1 | |
11 | + * long 64 1 | |
12 | + * float 32 2.99 | |
13 | + * doube 64 2.99 | |
14 | + * boolean 8 true | |
15 | + * | |
16 | + * OPERADORES | |
17 | + * + soma inteira e ponto flutuante | |
18 | + * - subtraçao ou troca de sinal inteira e ponto flutuante | |
19 | + * * multiplicaçao inteira e ponto flutuante | |
20 | + * / divisao inteira e ponto flutuante | |
21 | + * % resto divisao de inteiros | |
22 | + * ++ incremento inteira e ponto flutuante | |
23 | + * -- decremento inteira e ponto flutuante | |
24 | + * | |
25 | + * OPERADOR | |
26 | + * && AND | |
27 | + * || or | |
28 | + * ! not | |
29 | + * | |
30 | + * > maior do que | |
31 | + * >= mario ou igual a | |
32 | + * < menor do que | |
33 | + * <= menor ou igual a | |
34 | + * == igual a | |
35 | + * != diferente de | |
5 | 36 | */ |
6 | 37 | package primeiroprojetojava; |
7 | - | |
38 | +import java.util.Scanner; | |
8 | 39 | /** |
9 | 40 | * |
10 | 41 | * @author user |
11 | 42 | */ |
12 | 43 | public class Main { |
13 | - | |
14 | 44 | /** |
15 | 45 | * @param args the command line arguments |
16 | 46 | */ |
17 | - public static void main(String[] args) { | |
18 | - System.out.println("Ola Mundo"); | |
47 | + public static void main(String[] args) { | |
48 | + | |
49 | +// int a; // declaracao variavel simples | |
50 | +// final double z; // declaraçao de variavel 'constante' | |
51 | +// a = 10; | |
52 | +// String b; | |
53 | +// b = String.valueOf(a); | |
54 | +// | |
55 | +// if (a>=10) { | |
56 | +// System.out.println(b); | |
57 | +// } | |
58 | + | |
59 | + Scanner scan = new Scanner(System.in); | |
60 | + | |
61 | + int num2 = scan.nextInt(); | |
62 | + int num1 = scan.nextInt(); | |
63 | + double num3 = scan.nextDouble(); | |
19 | 64 | |
65 | + System.out.print(num2+num1); | |
66 | + System.out.println(num3); | |
67 | + scan.close(); | |
20 | 68 | } |
21 | 69 | |
22 | 70 | } | ... | ... |