Read/write file contents in java (example/InputStreamReader/OutputStreamWriter)
Read & Write file in java using InputStreamReader & OutputStreamWriter class. We will write contents to a file using OutputStreamWriter […]
Read & Write file in java using InputStreamReader & OutputStreamWriter class. We will write contents to a file using OutputStreamWriter […]
Create or write file in java using FileOutputStream class. FileOutputStream writes the contents to file as stream of bytes. The
Request response flow in client server (REST Web service) We have shown the request response mechanism of service and client
1. What is unchecked exception in java? Unchecked exceptions are not checked at compiled time. The unchecked exceptions are not forced
Difference between checked and unchecked exceptions in java. Discuss the exception class hierarchy showing checked & unchecked exception in java.
We will discuss the difference between error & exception in java. We will demonstrate exception class hierarchy in java. We
What is OutOfMemoryError ? The OutOfMemoryError is thrown by JVM, when JVM does not have enough available memory, to allocate. OutOfMemoryError falls
Create & simulation deadlock situation using multiple threads (concurrency). Cyclic dependency of resource results in deadlock (example/java)
1. What is throw in java? throw is a keyword in java. When an exceptional or unintended situation occurs in
Three Fruit basket puzzle: There are 3 baskets or boxes containing apples, oranges and mixed fruits (apples and oranges). Apple
100 prisoners & a light bulb puzzle: There are 100 prisoners in the prison cells. Prisoners cannot communicate with each
Way to Heaven or Hell puzzle You are standing in front of two doors, one door leads to heaven and
Let us discuss final, finally and finalize in java with code examples. What is final ? final is a keyword
1. What is immutable class? The class whose state does not change after its construction is called immutable class. There
StringBuilder and StringBuffer are mutable classes StringBuilder & StringBuffer are mostly used, when we expects the modifications in string. e.g. Join two
1. Different methods to join or concatenate strings in java Join String using + operator Combine String using String concat method Contact String
Java stream library have streams specifically for primitive types like int, long, double etc. With primitive streams, values are directly
Java 8 Stream: groupBy, mapping and statistics, lambda stream example. Discussed IntSummaryStatistics (min,max,avg) of List of Person objects.
Given an array containing unsorted integers 0,1 & 2. Sort the given input array using non recursive method. Dutch national flag
What is merge sort algorithm? Merge sort(or MergeSort) is efficient, comparison based algorithm. The properties of merge sort algorithm are
Given unsorted array in java, Sort integer array – Quick sort (partition-exchange) algorithm. Quick sort is divide & conquer algo. complexity : O(n log n).
Given the model annotated with @JsonInclude annotation. Sometime the model objects are in third party jars or libraries, so we
Given a user defined object or POJO having null fields (i.e. some fields are null). When we are serializing object the null
Given an list of user defined objects or POJO and object may contains the empty values (e.g. null values or
Given a list of user defined objects or POJO and object may contains the null values. When we are converting
Given a list of user defined objects or POJO and object may contains the empty values (e.g. null values or
Given the list of user defined objects or POJO and object may contains null values. When we are converting list
What is insertion sort algorithm? Insertion sort is a sorting technique. The elements are inserted at an appropriate place in an
Given an enum in java. Convert enum to integer & vice Versa. Convert enum to string value & vice Versa.
Create a temporary file in java. We can create temporary file by specifying prefix, suffix (or directory) We will demonstrate