URL shortening using Google API Sometimes we need to share a long URL or we need to tweet them. But because of the length of the URL we are not able to do so. Google provides a service using which we can convert our long URL and squeezes them to fewer character URL. This service of Google is also known ... Read More »
Java Core
GSON encoding the string like \u003d
This tutorial explains how to handle the encoding issue by using GSON. Below is a sample program in which GSON was converting string, with some special character, into some encoded character. But when we printed the GSON string it gave some different output other than what was supposed to be. The issue with the above code is GSON is encoding ... Read More »
How to encode decode String in Java base64 Encoding
Base64 Encoding Algorithm Base64 encodes String using an algorithm which uses 64 printable characters to replace each character in original string in an algorithmic sequence so that it can be decoded later. Base64 encoding prevents misuse of data by encoding it into ASCII format. Base64 is real simple and easy to use for simple encoding needs. There are more advanced ... Read More »
How to read and parse CSV file
This tutorial shows how to read, parse and print out the values from a CSV file. Say we have a CSV file user-profile.csv where the user name, roll number, age, course name is stored, seperated by comma. Sample file data Extracts the Roll Number and Course from above CVS file, and print it out. Read More »
What is Memory Leak & How can we avoid Memory Leak
Memory leak occurs when programmers create a memory in heap and forget to delete it. Memory leaks are particularly serious issues for programs which by definition never terminate. Usually developers talk about memory leaks but when you ask them what that means many have no idea. To prevent these situations, Lets discuss about memory lean in detail. Memory that is ... Read More »
How to install visualvm in Ubuntu
VisualVM is a visual tool, integrating several command line JDK tools and lightweight profiling capabilities. Designed for both production and development, it further enhances the capability of monitoring and performance analysis for the Java platform. VisualVM is designed for- Java Developer: Monitor, profile, take thread dumps, browse heap dumps. System Administrator: Monitor and control Java applications across the entire network. ... Read More »
Difference between JDK, JRE and JVM
If we are a Java developer, it is very often that we think about understanding the JRE,JVM and JDK. It would be quite easy for us to visualize things in logical manner. Let’s see the basic differences between the JDK, JRE and JVM. JDK (Java Development Kit) Java Developer Kit contains tools needed to develop the Java programs, and JRE ... Read More »
Differences between the commands “mvn clean package” and “mvn clean install”
Well, both will clean. That means they’ll remove the target folder. Package will compile your code and also package it. For example, if your pom says the project is a jar, it will create a jar for you when you package it and put it somewhere in the target directory (by default). Install will compile and package, but it will ... Read More »
Create a Java project with Apache Maven
In this tutorial, we will learn how to create a Java project with Maven, imports it into the Eclipse IDE, and package the Java project into a jar file. Tools used : Maven 3.2.5 (For how to install, click here) Eclipse (Kepler Release) JDK 7 A. Create a Java Project from Maven Template In a terminal (*uix or Mac) or ... Read More »
Regular Expression in Java
Java provides the java.util.regex package for pattern matching with regular expressions. A regular expression is a special sequence of characters that helps you match or find other strings or sets of strings, using a specialized syntax held in a pattern. They can be used to search or edit or manipulate data. The java.util.regex package primarily consists of the following three ... Read More »
Jkoder.com Tutorials, Tips and interview questions for Java, J2EE, Android, Spring, Hibernate, Javascript and other languages for software developers