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 …
Core Java
java.lang.OutOfMemoryError: PermGen space
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
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 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
This tip explains the use of volatile keyword in Java. The keyword volatile (Java) is used in the multithreaded environment. also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials Volatile Keyword in Local Variables in the Thread If you are working with the multithreaded programming, the volatile keyword will be more …
What is transient keyword in Java?
Java Transient Keyword This article explains about the transient variable and when it will be used in the Java programming. Another important fact is that, this question is most frequently asked in the Java interviews for checking the basic knowledge of a programmer. Another point is that the Java transient keyword is not frequently used …
Ordering Queue Using Comparator Interface and PriorityQueue
The basic use of Queue class is to provide a data structure which allows storing objects in a First in First out(FIFO) format. But sometimes one wants to maintain the ordering, based on some other metric. This is exactly the purpose of PriorityQueue, another Queue implementation. You provide it a Comparator, and it does the …
Hiding and Overriding Methods In Java
Now in section Inheritance mainly in Hiding And Overriding Methods can we predict the output of the following program? also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials It Prints: Here the overriding methods getX and getY in class RealPoint have the same return types as the methods of class …