This Java tutorial is to help understand what are abstract classes and methods. This tutorial is applicable for Java beginners. An abstract class in Java cannot be instantiated. It does not end with it. Can a Java abstract class have a constructor? Can an abstract method be defined as static? If you are not comfortable […]
Published to Java Tutorial on 07/07/2015.
This Java article is to introduce and discuss about Integer Cache. This is a feature introduced in Java 5 to save memory and improve the performance. Let us first have a look at a sample code which uses Integers and showcases the Integer Cache behavior. From there lets study how and why it is implemented. […]
Published to Java Tutorial on 22/03/2015.
This is a beginner level tutorial on using the Jackson JSON API to convert between Java objects and JSON data. We have been seeing a RESTful services tutorial series in the recent past. I will be using JSON conversion in RESTful services in the coming weeks. This JSON tutorial is to help started with it. […]
Published to Java Tutorial on 08/03/2015.
This Java article is to discuss about the numeric promotion that happens when using operators. Similar to the last Java puzzle on floating point precision, this article will also make raise some eyebrows. Last week a regular reader of Javapapers Palani Kumar wrote to me and asked a question, “Why I cannot add two byte […]
Published to Java Tutorial on 14/07/2014.
In this Java fundamentals tutorial let us see about casting in Java. This tutorial is having two parts, the first one is for casting on reference types and the second is for primitives cast. In each part let us see about the different types of cast available and how we can use them in Java. […]
Published to Java Tutorial on 10/03/2014.
Method reference in Java 8 is the ability to use a method as an argument for a matching functional interface. :: (double colon) is the operator used for method reference in Java. An interface with only one method is called a functional interface. For example, Comparable, Runnable, AutoCloseable are some functional interfaces in Java. Its […]
Published to Core Java Tutorial on 19/11/2013.
This Java tutorial is to help Java beginners add a Java class or jar files to the Java classpath. java.lang.ClassNotFoundException is one of the frequently faced exceptions for a Java beginner. ClassNotFoundException is thrown when the referred Java class is not found by the Java runtime. Following are the different ways to add a Java […]
Published to Java Tutorial on 10/09/2013.
Releasing unused objects for garbage collection can be done efficiently using java weak reference. Yes. weak reference is related to garbage collection. In java we need to not anything explicitly for garbage collection (GC), this memory management overhead is taken care by java run-time itself. Then what is the use of java weak reference? Let […]
Published to Core Java Tutorial on 10/02/2013.
Varargs is a helper syntax and it enables use of variable number of arguments in a method call. In method definition variable aruguments are indicated by elipsis (…) and is called as ‘variable arity method’ and ‘variable arity parameter’ in java language specification. While invoking the varargs method we can use any number of arguments […]
Published to Core Java Tutorial on 01/07/2012.
Annotation is code about the code, that is metadata about the program itself. In other words, organized data about the code, embedded within the code itself. It can be parsed by the compiler, annotation processing tools and can also be made available at run-time too. We have basic java comments infrastructure using which we add […]
Published to Core Java Tutorial on 03/06/2012.