Java Serialization
What is Serialization? In Java, object serialization means representing an object as a sequence of bytes. The bytes includes the object's data and information. A serialized object can be written into a...
View ArticleCompile and Run Java in Command Line with External Jars
The following example shows how to compile and run Java program in command line mode with external jars. It is developed under Linux. 1. Compile & Run Java Program Without External Jar Let's create...
View ArticleCreate Java String Using ”” or Constructor?
In Java, a string can be created by using two methods: String x = "abc"; String y = new String("abc"); What is the difference between using double quotes and using constructor? 1. Double Quotes vs....
View ArticleHow Developers Sort in Java?
While analyzing source code of a large number of open source Java projects, I found Java developers frequently sort in two ways. One is using the sort() method of Collections or Arrays, and the other...
View ArticleJava Remove Element from ArrayList
To remove some elements from an ArrayList while iterating over the ArrayList, we need to use Iterator. Integer[] arr = {1,2,3,4,5,6}; ArrayList<Integer> list = new...
View ArticleCompile and run Eclipse Java projects from Linux terminal
If you are developing a Java project in Eclipse under a linux system, you may want to remote access the project from another location. You can remote desktop the linux box by using teamviewer, but...
View Article