Hello Jar

.jar, the wrapped or archived Java application to be used or run on any system with required java run time (JRE). It should have main method, the entry point to start the execution of the application. You can create the jar file with the help of inbuilt Java Archive Tool which is provided in JDK. Continue reading “Hello Jar”

BubbleSort with Java

Bubble sort is one of the easiest algorithms. It simply uses iteration and swapping in it. In this algorithm smaller elements of the array or list  bubbles up to first that’s why it’s named as bubble sort.

Say we have array of {5, 4, 0, 3, 7}, than bubble sort takes first element Continue reading “BubbleSort with Java”

Default String representation of Object

I have seen many questions on StackOverFlow where users comes up with the output which contains some gibberish(at least they feel so) text like abc@195a09c. So, let’s see what this output actually means. Continue reading “Default String representation of Object”

Text file to String in one line

In Java there are lot of ways to read the files. You can use FileReader, BufferedReader etc. But sometimes you want to read text file and store it directly to the String. For example you have String with numbers which are there to provide some data to your program. Continue reading “Text file to String in one line”