السلااام عليكم
اخوي احمد تقدر تفهمني ليش طلع الجواب كذا لاني عجزت افهم
كود:
2. abstract class Figure
{
void display( )
{ System.out.println("Figure"); }
}
//*
abstract class Rectangle extends Figure
{ }
//*
class Box extends Rectangle
{
void display( )
{ System.out.println("Box"); }
}
//
public static void main(String[ ] args)
{
Figure f = new Box( );
f.display( );
Rectangle r = (Rectangle)f;
r.display( );
}
What is printed?
a) Box
Box
b) Box
Figure
c) Figure
Box
d) Figure
Figure
المشكله ان اغلب اسئله الانهرتنز و الشيئ \ه مو عارفه احلها الله يستر
الحل ذا السؤال هو A ارجو الشرح لي ><