Getting started with Spring Boot on OpenShift

In the previous post, I described how to run MongoDB on an OpenShift gear. In this, I expand the topic and explain about deploying a Spring Boot application to OpenShift. Basically, Spring Boot is an abstracted version of Spring with the purpose of fast development of production-ready apps. Spring Boot …

How to get rid of getter, setter in Java

One of the boring stuff to do in programming is to add getter, setter methods. Thanks to IDEs nowadays with few clicks or pressing shortcut keys you are able to add getters and setters to code. However, still much of coding space is wasted and besides that from my point …

IntelliJ IDEA shortcuts for Eclipse users

Introduction IntelliJ IDEA IDEs are very popular among developers, especially Java folks. In addition to that, they support multiple languages such as Java, Scala, C/C++, Python, etc. I have recently switched from Eclipse to IntelliJ for Java development. At first, I had very difficult time to give up Eclipse convenient …

Difference between abstract and interface in Java

One of the most repetitive programming interview question is “what’s the difference between abstract and interface classes?”. To answer this question I have had search the internet to come with a complete answers in bullet points. I tried to cover as much as I can. Below is the end result …

Few hints about Apache Ant

Apache Ant is one of the most awesome automation tools, even though it is not as good as Maven. If nowadays I want to select an automation tool for a new project definitely I got with Maven, but before it existence Ant was rolling. Recently, I had to work with …

How to create RESTful web service in Spring

Spring provides many facilities to Java developers which ease the programming as well as reducing the complexity of the code. One of the most powerful features Spring supports is called invasion of control or dependency inject. In addition to that, throughout the years Spring framework has had tremendous growth and …

Object-relational mapping in Java

Object-relational mapping (ORM) is a technique which allows programmers to access a relational database from an object-oriented language and programmers do not need to map and type cast each column of database to classes manually. In other word, ORM technique take care of populating the result sets. In Java there …

Transaction in JDBC

Java JDBC is a very simple and basic library to access to database data, but it is quite common and easy to setup that is why it is kind of popular. However, it has various shortages such as Object-relational mapping (ORM) and Transaction Management. The latter though can be done …

How to add Gson library to Android Studio project

Google Android Studio from my point of view is the most suitable IDE for native Android programming. It is simply works out of the box. However, during working with this IDE, I have faced the shortage of documentation. Unfortunately, majorities of tutorials have been written for Eclipse IDE and since …

How to install WindowBuilder in Eclipse

Eclipse is my favorite IDE for coding especially for Java programming, even though it might be slower than other IDEs or has high RAM usage. Eclipse has different versions for different programming languages (C/C++, PHP, JavaScript, etc.). For long time, I was using Netbeans to develop Swing applications because it …

Instantiate a class by name stores in String

For beginners like me that are not very familiar with object oriented concepts, it might be impossible to imagine that Java has a capability to instantiate a class by its name stored in a string variable. However, this is totally possible in Java or even in other programming languages with …

Multithreading example in Java

In the previous post I discussed about multithreading concepts and provided a case study to understand the principles better. In this post the solution of the case study is given with detailed explanation about it. As mentioned, the first thing that program should do is to categorize mails, this is …

Basic of Multithreading programming

Multithreading is one the most interesting topics in computer computer science and programming. Of course it is also difficult and cumbersome for programmers even professional ones. Doing multithreading programming requires some prior knowledge regarding the thread and process. This post dedicates to Java multithreading programming and I tried as much …

Finding similarity percentage between Strings

In the field of text mining, one of the useful tools is to find the similarity percentage between two words for clustering or other purposes. Actually, I am not so familiar with text mining but it sounds quite interesting topic and I would like to do more study to find …

Sample Java generic code

Few days ago I was discussing with a friend of mine regarding some OOP concepts such as overriding, overloading, polymorphism and finally the discussion leaded to Generics in Java. Tonight, I have gotten little bit time to practice Generics. Basically, Generic is a type, for better understanding like Object type …

Copy file code with progress bar in Java

How does copy file progress bar works? This might be the question of many programmers including myself. The mechanism is very simple, first the size of the destination file should be retrieved and then divided to 100. In the next step while the program reads the destination  file, we can guess …