Month: December 2018

Java

Thread Dump Analysis

In this article we are going to demonstrate how to identify issues with threads and analyze the thread dump by creating a deadlock situation. Problem Create a deadlock between two threads. Java Code Analysis using jconsole Open Jconsole and connect to the JVM where deadlock has occurred. Open Thread tab and identify the problem Thread0 …

Uncategorized

Internationalization

ResourceBundle In this tutorial we are going to demonstrate the power of ResourceBundle and how we can leverage the same to make Java apps internationalize. In order to retrieve local specific values from a properties file we need to create multiple local specific MessageBundle files in the format MessageBundle_<locale>.properties and put them in classpath. Now …

Uncategorized

Java8 functional programming vs OOPS

Problem statement Problem is to display object type on console given a list of objects. Object can be any of rectangle, circle, parallelogram etc. For e.g# if object is a circle display “I am a circle” on console etc. OOPS approach# Below is the OOPS approach to solve the problem.We end up creating a bunch …

Uncategorized

Netstat and Java Socket Programming

In this article we are going to demonstrate netstat commands usage by creating a client and server open connection using Java socket programming. Netstat Netstat command is used to figure out how many Transport layer connections are created between systems. This information is useful to figure out the issues related to heavy usage of your …