Validate checksum in Linux.

For example there is one file FileName.txt in server with following checksum, sha1 : 69c7b0f0d46dfc7a0q693e725534cd20f6d98a1e md5 : 9e9021c288c0f107ed772baa6ac49f86 You downloaded it in your pc and now you want to compare it’s checksum with server. 1. Validate sha1 checksum Open terminal. Type following command $ sha1sum FileName.txt | grep 69c7b0f0d46dfc7a0e693e725534cd20f6d98a1e You will get following output if […]

Share
Continue reading →

clone method in Java

clone method is a part of Object class like equal method. We can override clone method in any class. But to use clone method we need to implement Cloneable interface. Without implementing Cloneable interface you can not use clone method otherwise It will throws CloneNotSupportedException Clone method is used to create clone of object. IMPORTANT […]

Share
Continue reading →

Selection sort in java

This article is about selection sort in java For example we want to sort below array of integers. int[] index = { 10, 34, 4, 56, 7, 67, 88, 42 }; Selection sort start with first position means here it takes 10 and compares it with each and every other integers in array starting with […]

Share
Continue reading →

Java wait and sleep methods with example

Difference between wait and sleep 1. sleep() is a static method and It sends current running thread into the “Not Runnable” state. wait() is a instance method we are calling it using thread object and it is only affected for that object. 2. sleep() : Thread weak up after time expire or call interrupt() method. […]

Share
Continue reading →

Atomic and Non-Atomic Operations in Java

This article is all about atomic operations in java. Atomic operations are take place in one step. Like read and write operation of variable. atomic operations cannot be interrupted and they are thread safe, In java read and write operations are atomic for all variables which are less or equal to 32 bit. In some […]

Share
Continue reading →

Volatile in Java

volatile is a keyword in java. It is use with variable, You can not use it with method or class. volatile keyword tells JVM and Threads that don’t cache the value, always read from main memory. volatile variable is visible across all threads. All threads will always gets updated values . Use of volatile volatile […]

Share
Continue reading →

Insertion sort in java

This article is about insertion sorting algorithm in java. For example we want to sort below array of integers. int[] input = { 5, 3, 8, 14, 24, 13, 35, 1, 2, 0 }; Insertion sorting start with comparing 2nd integers with first integer like in above array we will compare 3 with 5 here […]

Share
Continue reading →