Skip to content

Tag Archives: java-overriding

Default method in Java is a method in java which are defined inside the interface with the keyword default is known as the default method.… Read More
The covariant method overriding approach, implemented in Java 5, helps to remove the client-side typecasting by enabling you to return a subtype of the overridden… Read More
The finalize() method of Object class is a method that the Garbage Collector always calls just before the deletion/destroying the object which is eligible for… Read More
Method Overloading: Method Overloading is a Compile time polymorphism. In method overloading, more than one method shares the same method name with different signature in… Read More
How to overload main method in java? Method Overloading can be defined as a feature in which a class can have more than one method… Read More
Prerequisites: Method Overriding in java and Access Modifier in Java Method Overriding In any object-oriented programming language, Overriding is a feature that allows a subclass… Read More
Prerequisite: Exception and Exception Handling in Java, Overriding in Java, Checked and Unchecked Exception. An Exception is an unwanted or unexpected event, which occurs during… Read More
Prerequisite : Overriding in Java, Packages in Java Packages provide more layer of encapsulation for classes. Thus, visibility of a method in different packages is… Read More
Whenever we override start() method then our start() method will be executed just like a normal method call and new thread wont be created. We… Read More
Constructor is a block of code that allows you to create an object of class and has same name as class with no explicit return… Read More
In any object-oriented programming language, Overriding is a feature that allows a subclass or child class to provide a specific implementation of a method that… Read More
This post is similar to Overriding equals method in Java. Consider the following Java program: // file name:    class Complex {     private double… Read More
Consider the following Java program: class Complex {     private double re, im;                public Complex(double re, double im) { = re; = im;… Read More
As private, protected and public (access modifiers) affect the accessibility and scope of the field. So, the method cannot be private which are called from… Read More