Java/ J2EE, Oracle Adf Blog
Thursday, 12 February 2015
Method Overriding
class
Vehicle{
void
run(){System.out.println(
"Vehicle is running"
);}
}
class
Bike2
extends
Vehicle{
void
run(){System.out.println(
"Bike is running safely"
);}
public
static
void
main(String args[]){
Bike2 obj =
new
Bike2();
obj.run();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment