분류 전체보기
-
CompletableFuture, and FutureStaticPL/JAVA 2019. 8. 20. 11:12
1. Overview CompletableFuture and Future are used for asynchronous programming in Java. Asynchronous programming is a means of writing non-blocking code by running a task on a separate thread than the main application thread and notifying the main thread about its progress, completion or failure. So Main thread doesn't block/wait for the completion of an async task and it can execute other tasks..
-
Bridge Design PatternModeling/DesignPattern 2019. 8. 19. 23:05
1. Overview Bridge belongs to Structural patterns. This pattern allows us to vary independently between abstraction and implementations. but if Bridge has to be designed in advance, then only we can have varying abstractions & implementations. it has two parts. Abstraction Implementation Abstraction – the core of the bridge design pattern and defines the crux. Contains a reference to the impleme..
-
ThreadlocalStaticPL/JAVA 2019. 8. 19. 22:28
1. Overview Clarify what Threadlocal is and how and when to use it. 2. Introduction Threadlocal has the ability to store data individually for the current thread. Thus, even if multiple threads are executing the same code, and the code has a reference to a Threadlocal variable, there's no need to synchronize that variable because multiple threads cannot see each other's Threadlocal variables. 3...
-
Thread and RunnableStaticPL/JAVA 2019. 8. 18. 20:33
1. Overview Summarize Thread in JAVA. Thread class provides constructors and methods to create and perform operations on a thread. It is derived from Object class and implements the Runnable interface. Threads can be created by using two mechanisms : Extending the Thread class Implementing the Runnable Interface 2. The life cycle of Threads 2.1 NEW Thread instance newly created, have not started..
-
Difference between Concurrency and ParallelismModeling/TheoremParadigm 2019. 8. 18. 20:31
1. Overview Distinguish two concepts in detail. 2. Comparison Between Concurrency and Parallelism Concurrency Parallelism Basic Running multiple computations at the same time Running multiple computations simultaneously Achieved through Interleaving operation Using multiple CPU's Benefits An increasing amount of work accomplished at a time Multiple CPU's for operating multiple processes Make use..
-
StreamStaticPL/JAVA 2019. 8. 18. 20:25
1. Overview Added from JAVA 8. A stream is a sequence of objects that supports various methods that can be pipelined to manipulate results. Stream operations are either intermediate or terminal. Intermediate operations return a stream so we can chain multiple intermediate operations without using semicolons. Terminal operations are either void or return a non-stream result. 2. Features Do not ch..
-
Difference between Abstract Class and InterfaceStaticPL/JAVA 2019. 8. 18. 20:24
1. Overview Clarifying differences between abstract class and interface. 2. Difference between Abstract Class and Interface Features Abstract Class Interface Type of methods Abstract, non-abstract Abstract, default, static methods Type of variables Final, non-final, static, non-static Final, static Implementation Able to implement interfaces, able to extend another class Only extends Interfaces ..
-
Polymorphism, Upcasting, And DowncastingModeling/TheoremParadigm 2019. 8. 18. 20:21
1. Overview Organize Polymorphism, Upcasting, and Downcasting. and then find usages and pitfalls each casting. 2. Description 2.1 Polymorphism The ability of an object to take on many forms. All methods in Java are virtual by default. so Any method can be overridden when used in inheritance unless that method is declared as final or static. When we cast object only the reference type of the obje..