What is difference between error & exception in java (class hierarchy/ example)
We will discuss the difference between error & exception in java. We will demonstrate exception class hierarchy in java. We […]
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
What is selection sort algorithm? Selection sort is sorting technique used to sort the elements in list data structure like array.
Given an unsorted array in java. Sort the given input array using bubble sort algorithm. Bubble sort is a sorting
Given an array containing even and odd number in java. We would like to classify the even and odd numbers.
Given an integer array containing 0 and 1. We would like to sort input array. Zeros will be left end
Problem Statement: Given an array of integer, we would like to find out, whether array contains any duplicate elements. The