Pick a pair of concrete classes in the JDK in a parent-child relationship and discuss a few polymorphic and/or overloaded methods.
Do not use Object as the parent class - it is too trivial to address the issues to be addressed here, and in any case, Object is the final parent of all classes in Java.
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
1)you can take instance of JButton magnificence javax.swing.JButton.java
2) AbstractButton.java is parent class for
JButton(javax/swing/AbstractButton.java)
3) In JButton class there are 2 overloaded features
(Funtion with equal call and special parameters)
those are 2 constructors (Initilization of class)
//JButton Constructor with Button textual content and Button
background Icon
public 1x1.gifJButton(String text, Icon icon) {
}
//JButton Constructor with on Button (Default history can be
used)
public 1x1.gifJButton(String text) {
}
4)The above I defined is assemble time polymorphism (equal approach names)
5)And also RunTimeException.java and ArithmaticException.java are in Inheritence relationship
Kindly revert for any queries
Thanks.
Get Answers For Free
Most questions answered within 1 hours.