Garbage Collector in Java

Java is capable of automatically releasing the unreferenced memory. This is achieved when a object is unused. To make a object unused make the reference variable pointing to that object as null pointer. Lets see an Example below, public void TestMethod() { String s = new String(“Welcome to CodeParent”); System.out.println(s); s = null; } Other options in java you can use System.gc() and Runtime.gc() methods, if you call these methods explicitly, the JVM makes efforts towards recycling the unused objects, but there is no guarantee…

Continue reading »

Microservices Architecture in Cloud | How different is SOA and Microservices

Microservices are the evolution from SOA architecture. As we know, the traditional Monolithic Architecture lacks in granular scalability and consumes lot of time to build and deploy, SOA was born. And with the increasing adoption of Cloud technologies and DevOps the rise of Microservices over SOA is inevitable. How different is SOA and Microservices? – The talk of the town question is here. The answer is simple, Microservices are more granular than SOA. Service Oriented Architecture is coarsely grained and Microservices are finely grained. SOA…

Continue reading »

The final Keyword in Java

Final Variables: Variables that are final are prevented from being modified. Once it is declared and initialized, it can’t be changed after that. final int marks = 95; final float score = 80.50f; Ant attempts to modify the above variables will throw a compile-time error. Points to Remember: Final variables must be initialized during its declaration. Final Methods: A method that is declared as final cannot be overridden in a subclass. public final int marks() {} Points to Remember: marks() cannot be overridden in subclass.…

Continue reading »