File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed
13 - Multithreading/13.5 - Thread Priority/src
17.1 - Printing values using external iteration/src
17.12 - 17.16 Stream Map, Reduce methods/src
18 - New DateTime Api/18.1 - New DateTime Api/src
9 - String + Builder + Buffer/9.3 - User input using System.in.read()/src Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ public static void main(String[] args) throws InterruptedException {
2828 System .out .println ("BYEEE IN BETWEEN" ); // This won't be printed at the end because Main thread is idle and will execute this before only.
2929 System .out .println ("Is t1 alive: " + t1 .isAlive ());
3030
31- t1 .join (); // will wait for t1 to complete execution and join main thread
32- t2 .join (); // will wait for t2 to complete execution and join main thread
31+ t1 .join (); // will wait for t1 to complete execution and join main thread
32+ t2 .join (); // will wait for t2 to complete execution and join main thread
3333 System .out .println ("BYEE AT THE END" );
3434
3535 System .out .println ("Is t1 alive: " + t1 .isAlive ());
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ External Iterations (loop outside the object)
1515 - for each loop
1616 Internal Iterations (loop inside the object)
1717 - forEach method
18- */
18+ */
1919
2020import java .util .Arrays ;
2121import java .util .Iterator ;
Original file line number Diff line number Diff line change 55
66Internal Iterations: (Stream API)
77 - just focus on what to do
8- */
8+ */
99
1010import java .util .Arrays ;
1111import java .util .List ;
@@ -19,8 +19,8 @@ public static void main(String[] args) {
1919
2020 // We need to find the sum of all the values*2
2121
22- int result = 0 ;
2322 // 1) Using traditional for-each loop
23+ int result = 0 ;
2424 for (int value : values ) {
2525 result += value *2 ;
2626 }
Original file line number Diff line number Diff line change 1010 Changes in new DateTime API:
1111 - new package time was created
1212 - Date object only print Date now, and not Time to avoid confusion
13- */
13+ */
1414
1515import java .time .Instant ;
1616import java .time .LocalDate ;
Original file line number Diff line number Diff line change 66 - returns byte value in the form of int in range 0 to 255
77 - that value is basically the ascii value of that character
88 - not efficient
9- */
9+ */
1010
1111public class Test {
1212 public static void main (String [] args ) throws Exception {
You can’t perform that action at this time.
0 commit comments