Explain in depth Garbage collector ?

Garbage collection is the process of automatically freeing objects that are no longer referenced by the program. This frees the programmer from having to keep track of when to free allocated memory, thereby preventing many potential bugs. Thus making programmers more productive as they can now put more effort in coding rather than worrying about … Read more

What are Native methods in Java ?

There may be times when we want to call subroutines which are written in some other language other than Java like C++, VB6 etc. In Java, native methods refer to methods that are implemented in a language other than Java, typically in languages like C or C++. These methods are declared with the native keyword … Read more

What is the use if “instanceof” keyword ?

instanceof” keyword is used to check what is the type of object. F The instanceof keyword in Java is used to test whether an object is an instance of a particular class, interface, or subclass. It is a binary operator that returns a boolean value – true if the object is an instance of the … Read more

What are packages ?

Packages group related classes and interfaces together and thus avoiding any name conflicts. From OOP’s point of view packages are useful for grouping related classes together. Classes are group together in a package using “package” keyword. In Java, a package is a mechanism for organizing classes and interfaces into a hierarchical structure. It helps in … Read more

How can we implement polymorphism in Java ?

Polymorphism is the capability of an action or method to do different things based on the object that it is acting upon. There are two types of polymorphism:- Method Polymorphism through overloading. Object polymorphism by inheritance / interfaces. Polymorphism in Java can be implemented through method overriding and interfaces. Here are the two main ways … Read more