Read write file using BufferedReader & BufferedWriter in java (example)
BufferWriter, writes to character based stream and BufferReader, reads from character based stream, so as to provide efficient writing/reading of […]
BufferWriter, writes to character based stream and BufferReader, reads from character based stream, so as to provide efficient writing/reading of […]
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
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
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.
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
Given the user defined object or POJO having date field, we would like to serialize the POJO to JSON. During serialization, we
Given a list of user defined objects, we would like to convert list of pojo objects to JSON (and JSON to list
Given an array of user defined objects, we would like to convert array of object to JSON and JSON to array
Given Map of String & object (Map<String,Object>), we would like to convert Map to/from JSON. We will use the jackson’s objectmapper to serialize
Given user defined object in java. Serialize deserialize POJO to JSON string – jackson objectmapper i.e. convert data members of object to json string.
Given the list of objects, convert list of objects to map. We will use lambda streams to convert list objects
Initialize One, Two & Three dimensional array in java. Create & print or loop/iterate static & dynamic multi-dimensional array in java (example).
Given the user defined object or POJO, having Date field, we would like to serialize the POJO to JSON. During serialization, we would
Given an list of user defined objects, we would like to convert list of pojo objects to JSON (and JSON to list
Given an array of user defined objects , we need to convert array of POJOs to JSON String. Also, we will convert
Given the Map of String and object (Map<String,Object>), we would like to convert Map to JSON and vice versa. We will use the
1. Read file using java 8 lambda stream Given a file, read input file by line by line using lambda