-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode3.java
More file actions
31 lines (22 loc) · 792 Bytes
/
Copy pathCode3.java
File metadata and controls
31 lines (22 loc) · 792 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
package Sesion_1_JavaSetup_JavaBasic;
public class Code3 {
public static void main (String[] args){
boolean bollVal = false;
System.out.println("bollVal = " + bollVal);
System.out.println(!bollVal);
//var = bool exp ? rez adevarat : rez neg ;
int a = !(3 < 5) ? 4 : 5;
String name = "Sam";
int age = name.equals("Sam") ? 30: 40;
System.out.println("Sam has " + age + "years");
int valA = 3;
int valB = 3;
if(valA < valB) {
System.out.println("First number is less then second one");
valB++;
}else if (valB < valA)
System.out.println("Second number is less than first one");
else
System.out.println("Numbers are equals!");
}
}