-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForPegadinhas.java
More file actions
32 lines (25 loc) · 950 Bytes
/
ForPegadinhas.java
File metadata and controls
32 lines (25 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
public class ForPegadinhas {
private void forSimples(int informeNumeroMenorQueDez){
for( ; informeNumeroMenorQueDez < 10 ; informeNumeroMenorQueDez++){
System.out.println(informeNumeroMenorQueDez);
}
}
private void forCompativeis(){
for (int x = 1,y = 10; x <= y || y >= x ; x++, y--){
System.out.println("Valor de x:" + x + " e de y:" + y +"." );
}
}
// private void forIncompativeis(){
// for (int x = 1, long y = 10; x <= y || y >= x ; x++, y--){
// System.out.println("Valor de x:" + x + " e de y:" + y +"." );
// }
// }
public static void main(String[] args) {
ForPegadinhas forPegadinhas = new ForPegadinhas();
forPegadinhas.forSimples(0);
System.out.println("---------");
forPegadinhas.forCompativeis();
System.out.println("---------");
//forPegadinhas.forIncompativeis();
}
}