Java
-
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 ..
-
JAVA Collection FrameworkStaticPL/JAVA 2019. 8. 18. 20:18
1. Collection 3. List: interface List is a fundamental and widely-used collection type in the Java Collections Framework. Basically, a list collection stores elements by insertion order (either at the end or at a specific position in the list). A list maintains indices of its elements so it allows adding, retrieving, modifying, removing elements by an integer index (zero-based index; the first e..
-
String, Char, StringBuilder, and StringBufferStaticPL/JAVA 2019. 8. 18. 20:16
1. Overview Finding Different between String and Char. Check each role on JAVA. 3. Description 3.1 String It's a Class having a class member of final char[] in it. It has String Pool in JVM for caching literal reference of instance. but generated separate reference on the pool if instances are created using new keyword each time. It's immutable like the final instance. So before JDK 1.5, if some..
-
hashcode and equalsStaticPL/JAVA 2019. 8. 18. 20:15
1. Overview Stands for hashing algorithms to search efficiently used in HashMap, HashSet, and so on. Searching element within collection using hash code as address. 2. Procedure 3. Terminology 3.1 Uniqueness The same Objects which are true on equal() respectively must generate the same hash code. Different Object prefers to generate different hash code for performance of searching, but shouldn't..