What is Immutable Objects in Java?

java-thumbnail

An immutable object is something whose state can’t be change after there creation, e.g. String objects. Once you have created a String object, you can’t alter this. Creating an Immutable object’s class Creating an immutable object’s class can be tricky. Minimal requirement to create an immutable object’s class is, make class and every member variable, […]

Novice way to implement a Singleton

java-thumbnail

I believe everyone starts (and even continues to do so) implementing Singleton pattern in following fashion: also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials Do you find any problem in it? Well, I have!!! The contract of Singleton class can be broken. Let’s discuss Singleton pattern in Simple Threaded […]

What is Remote Debugging in Java?

java-thumbnail

Consider a scenario where you can’t run the application in your development environment, e.g. say your application can run only on a server machine (because it is dependent on some third party interface that are not accessible in your development machine) and you have to resolve a problem (bug). What you can do? The solution […]

Runtime.addShutdownHook()

java-thumbnail

Preface Every Java Program can attach a shutdown hook to JVM, i.e. piece of instructions that JVM should execute before going down. also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials Problem A program may require to execute some pieces of instructions when application goes down. An application may go […]

Job Schedulers – UNIX

java-thumbnail

Job Schedulers – UNIX We might have worked on various Job Scheduling Frameworks, one of the famous one that comes to our mind is Quartz. Yes quartz is a cool frameworks which has advanced error handling, job scheduling and various other great feature. Recently while trying to create a scheduling task for a task in […]

java.lang.OutOfMemoryError: PermGen space

java-thumbnail

We encountered the dreaded java.lang.OutOfMemoryError: PermGen spaceerror What does it means – Permgen Space is the space where the class files are all loaded for the first time and there after they are loaded or referenced from there. This error means there is a hell lot of duplicate classes being loaded and not all are […]

java.lang.OutOfMemoryError: Java heap space

java-thumbnail

We encountered the dreaded java.lang.OutOfMemoryError: Java heap space error. How often do we hit this error and look in bewilderment. What does it means Means there is a hell lot of objects being created and not all are being marked for GC. These stray objects are cluttering the heap space and resulting in this error. […]

Java Vs. JavaScript

java-thumbnail

Java or JavaScript? Which should you learn? Which should you use? These two may seem similar, but there are some very key differences between the two programming languages. A quick look at what makes them similar and what sets them apart may help you decide which one is right for you. also read: Java Tutorials […]

Volatile keyword in Java

java-thumbnail

This tips explains the use of volatile keyword in Java. The keyword volatile is used in the multithreaded environment. also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials Local Variables in the Thread If you are working with the multithreaded programming, the volatile keyword will be more useful. When multiple […]

Working with arrays : java.util.Arrays class

java-thumbnail

The java.util.Arrays class is basically a set of static methods that are all useful for working with arrays. The Arrays class contains various methods for manipulating arrays (such as sorting and searching). In addition to that, it has got many utility methods for using with arrays such as a method for viewing arrays as lists […]