[Java] How to Schedule a task to run in an interval

There is often need in application to run some particular task in background to accomplish some work in an interval. The example can be, service running in background for cleanup of application just like, we have the Java Garbage collection. In this article, i will show you 3 different ways to achieve this They are... Continue Reading →

Using Google GSON : Extra Goodies : Part II

We continue with Using GSON from last article, also in case you missed the first article in series here is link. So, here we go with another installment in series. Versioning Support If you want to maintain multiple versions of an object for JSON conversion, Google GSON library has nice @Since annotation for it. This... Continue Reading →

Various ways to run Scala code

For running example in this tutorial, make sure that, you have latest Java distribution and Scala distribution installed on your machine and environment variable SCALA_HOME points to base directory of the Scala installation and %SCALA_HOME%/bin added to PATH variable. Using Scala REPL It is basically command line interactive shell called as REPL short for Read-Eval-Print-Loop. To... Continue Reading →

Java Compilation Unit

It is basically referred to a Java source code file, which forms the input for the Java compiler which is javac. This term is less commonly used among developers and it is technical jargon for Java source code file. This Java compilation unit has structure which is as follows - Some points about the compilation unit, these are somewhat based on... Continue Reading →

Java : Uses of this and super

In this post, I will list out possible uses of these two operators. Before that let me give brief details These are keywords having special semantic/meaning in language. Most uses are accessing the members or invoking the constructor. Uses of are valid within- Constructor, Instance initializer block, Instance initializer expression. Use in constructs than these are invalid and compiler will throw error accordingly. Uses... Continue Reading →

Initializing final member variables in Java

When you modify any variable declaration with final, you tell to compiler that once variable is initialized, its value cannot be changed.In other words, any further assignment of value is invalid attempt. While declaring variable as final , compiler also does some bytecode optimization as you might  have guessed they going to have only one... Continue Reading →

Variable initialization and default values

As discussed previous posts , we have seen various types of variables in Java. In this post, i am going to discuss about its initialization and default values. In Java, when variable is declared as field (static or instance variable inside class), then initialization of that variable is optional. In other words, while declaring field... Continue Reading →

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: