|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 5 of 10
class Point
{
void draw ()
{
System.out.println ("I am a point.");
}
}
class Circle extends Point
{
void draw ()
{
System.out.println ("I am a circle.");
}
}
According to the code fragment above, if you execute Circle c = new Circle (); c.draw ();, then I am a circle. will be your output. However, if Circle does not override draw() with its own method, you'll see I am a point. instead.
Suppose you have a subclass with a field and/or method that is identical to a superclass field and/or method and you want to access the superclass field or method from the subclass method. How do you accomplish that task? You'll find the answer in the following code fragment: