Java – Garbage Collection
Garbage collection in java is a way in which the unreachable objects are destroyed to free up space in memory. JVM creates a heap area which is called runtime data area, where all the objects are stored. And the space …
Garbage collection in java is a way in which the unreachable objects are destroyed to free up space in memory. JVM creates a heap area which is called runtime data area, where all the objects are stored. And the space …
Packages in Java are a way to pack(group) a number of related types such as classes, interfaces, enumerations, and annotations together into a single unit. Think of it as a container for the classes. Packages are used to avoid name …
In any object-oriented programming language, Method Overriding is a feature that allows the user to declare a method with the same name in a sub-class that is already present in a parent-class. That is when a sub-class inherits from its …
Read moreJava – Method Overriding with Example, Super Keyword
Method Overloading is one of the features in a class having more than one method with the same name. It is the same as Constructor Overloading in java. The methods are differed by their input parameter that is the data type, the …
Java Method is a collection of statements that are put together to perform some specific task. To run the methods, it should be called and it returns the value to the caller. Users can pass data to the methods and …
Java Inner class is also known as the nested class is a class within the class, method, or block declared inside class or interface. The use of the inner class is to group the classes or interfaces logically in one place …
The access modifiers in Java specifies the accessibility or visibility or scope of a field, method, constructor, or class. Java defines four access modifiers: Following shows their accessibility, default (Same class, Same package) private (Same class) protected ( Same class, Same package, Subclasses) …
An Interface in Java is the same as a class, like any other class, an interface can have methods and Variables. But unlike a class, the method in it is an abstract method (only method signature, contain no body), and also by …
A constructor is a block of codes just like a method in Java. It is a special type of method that is called when an instance of the class (that is object) is created and is used for the initialization …
Java is an Object-Oriented Language. And classes and objects are the fundamental components of OOP’s. Objects are real-life entity and classes are the blueprint for creating an object. For example: consider a class for a car, it has color, some weight, …