We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15a221c commit 8f5c859Copy full SHA for 8f5c859
10.Expressions_and_increment_decrement_operators/cwh_10_resulting_data_type.java
@@ -0,0 +1,26 @@
1
+package com.company;
2
+
3
+public class cwh_10_resulting_data_type {
4
+ public static void main(String[] args) {
5
+ /* byte x = 5;
6
+ int y = 6;
7
+ short z = 8;
8
+ int a = y + z;
9
+ float b = 6.54f + x;
10
+ System.out.println(b); */
11
12
+ // Increment and Decrement Operators
13
+ int i = 56;
14
+ // int b = i++; // first b is assigned i (56) then i is incremented
15
+ int j = 67;
16
+ int c = ++j; // first j is incremented then c is assigned j (68)
17
+ System.out.println(i++);
18
+ System.out.println(i);
19
+ System.out.println(++i);
20
21
+ int y = 7;
22
+ System.out.println( ++y *8);
23
+ char ch = 'a';
24
+ System.out.println(++ch);
25
+ }
26
+}
0 commit comments