We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Java Method Overriding 2 (Super Keyword)
Java Method Overriding 2 (Super Keyword)
Sort by
recency
|
123 Discussions
|
Please Login in order to post a comment
user super keyword
Because they don’t have a frame, the lens shape and size can be more varied, allowing for more experimentation with unique designs. Some rimless sunglasses even incorporate bold shop page, creative shapes and accents around the temples, offering the wearer a more individualized look that blends function and fashion. They can also accommodate different lens tints or finishes more easily, offering customization options for those who want to adjust their sunglasses for specific purposes like driving, sports, or outdoor adventures.
import java.io.; import java.util.;
public class Solution {
}
class Motorcycle{ public void print(){ System.out.println("Hello I am a motorcycle, I am a cycle with an engine.");
} class cycle extends Motorcycle{ @Override public void print(){ super.print();
}
}
my code:
import java.io.; import java.util.;
class bicycle { String text(){ return " with pedals.";
}
class moto extends bicycle{ String text(){ return " an engine.";
}
public class Solution {
}
Method overriding in Java lets a subclass redefine a method from its parent class, allowing for specialized behavior. The super keyword is used to invoke the parent class's method, ensuring the original functionality is preserved alongside the new implementation.
For more interesting insights and analyses, check out the latest Today IPL Match at for expert match forecasts and updates.