-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignmentO.java
More file actions
29 lines (28 loc) · 817 Bytes
/
AssignmentO.java
File metadata and controls
29 lines (28 loc) · 817 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
public class AssignmentO {
public static void main(String[] args) {
// assignment
int a = 10;
System.out.println(a);
int m, b, c, d;
m = 10;
b = 11;
c = 20;
d = 90;
System.out.println("m,b,c,d");
System.out.println(m + " " + b + " " + c + " " + d);
// chaining method of assigning
int k, l, n, p;
k = l = n = p = 70;
System.out.println("k,l,n,p");
System.out.println(k + " " + l + " " + n + " " + p);
int x = 10;
System.out.println("x=" + x);
x = x + 5;
System.out.println("x=" + x);
// we can do this by following assignment method
int y = 10;
System.out.println("y=" + y);
y += 5;
System.out.println("y=" + y);
}
}