-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIf,java
More file actions
22 lines (22 loc) · 703 Bytes
/
If,java
File metadata and controls
22 lines (22 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
public class Main {
public static void main(String[] args) {
int a = 15, b = 10;
if(a > b) {
System.out.println("Yes, true");
}
if(a != b) {
System.out.println("No, false");
}
char sym1 = 'A', sym2 = 'a'; //also with symbols
if(sym1 == sym2) {
System.out.println("No, false");
}//Java feels that A is not a
boolean HasCar = false;
if(HasCar) { // same as to write in brackets (HasCar == true)
System.out.println("No, false");
}
if(!HasCar) { // same as to write in brackets (HasCar == false)
System.out.println("Yes, true");
}
}
}