Java Tutorial Blog

Java Papers is a Java blog and tutorial website. Java Papers is passionately published by Joe for eight successful years. It has served millions of views and is one of the most popular Java blog in the Java community. Articles and tutorial published are of Java, Android, design patterns, web services, Spring framework, Servlets and JSP technologies. Java Papers helps to refresh your Java knowledge, keep updated with latest news, prepare for Java interviews and certifications. Welcome!

Recent Tutorial

SLF4J vs Log4j

Which one to use in my project either SLF4J or Log4j or both? Its been long since SLF4J came into picture and adopted heavily by projects all around. But certain things never get over. Like the difference between abstract class and interface in Java. Difference between SLF4j and Log4j is still a popular questions among […]
Published to Java Tutorial on 01/02/2016.

Java Puzzle: Class Name

Let us directly jump into the puzzle. Following code is a Java puzzle, read and guess the output. Then run, see the result and try to reason it. public class StringClass { public static void main(String[] args) { int a = 10 + 20; System.out.println(a); } } class String { private final String str; public […]
Published to Java Tutorial on 10/01/2016.

What we will Miss from Java in 2016?

We know about this news almost a month back. Just wanted to highlight to those who missed the news or didn’t come across it. Java 9 is postponed to 2017. Previously Java 9 was scheduled to be released in September 2016. Now the date of General Availability (GA) milestone is rescheduled [1] to 23 March […]
Published to Java Tutorial on 06/01/2016.

Java flatMap

In this Java 8 tutorial you can learn about what a flatMap is and in which scenario it can be used. flatMap is an intermediate operation of the Java 8 Stream API. If you are just into Java 8 and streams, I strongly recommend you to go through the linked tutorial to learn about streams […]
Published to Java Tutorial on 04/01/2016.

Spring @Order Annotation

@Order is used to define sort order for components annotated with this annotation. @Order annotation is available in Spring Framework since version 2.0. Till Spring 4 , it supports ordering only for AspectJ aspects. Spring 4 made a nice little enhancement to @Order annotation. It introduced support to ordering of auto-wired components in collections like […]
Published to Spring Tutorial on 14/10/2015.

Java NIO File Read Write with Channels

In this Java tutorial, we will see about how to read and write files using NIO channels. Channels are used for data transfer between a buffer and an entity. There are different channels like ByteChannel, FileChannel, SocketChannel and DatagramChannel. In this tutorial we will learn about using ByteChannel and FileChannel to perform file IO operations. […]
Published to Java Tutorial on 13/09/2015.

Java String vs StringBuilder vs StringBuffer Concatenation Performance Micro Benchmark

In this Java article I walk you through designing a micro benchmark to assess the performance between String + (plus operator), String.concat method, StringBuilder.append method and StringBuffer.method. These are all different ways using which we can append two string values. This is a well grinded topic over the period and everybody knows the result of […]
Published to Java Tutorial on 03/09/2015.

Spring Properties with @PropertySource Annotation

PropertySource is an abstract base class that represents a source of name value property pairs. @PropertySource is an annotation for declaring a PropertySource to Spring’s Environment. In this Spring tutorial, we are going to discuss the following three topics in detail with examples, Spring 3.1 @PropertySource Annotation @PropertySource Annotation improvements in Spring 4 Java 8 […]
Published to Spring Tutorial on 30/08/2015.

Java NIO Buffer

Buffer is a block of data that is to be written to a channel or just read from a channel. It is an object that holds data and acts as an endpoint in a NIO channel. Buffer provides a formal mechanism to access data and tracks the read and write processes. Buffer is one of […]
Published to Java Tutorial on 20/08/2015.

Java NIO Channel

In Java NIO, channels are used for I/O transfers. Channel is a like a tube that transports data between a buffer and an entity at other end. A channel reads data from an entity and places it in buffer blocks for consumption. Similarly, we should write to buffer blocks and that data will be transported […]
Published to Java Tutorial on 20/08/2015.