انا توني جديدة في دراسة البرمجة وارجوكم تساعدوني في حل البرنامج اللي يطلب فيه ما يلي :



Q2) write a java class that corresponding to the following instructions:
The class name is AB, which inherited from AC. AB class is a leaf class, means can’t be inherited any more. This class can be accessed anywhere.
Integer x, y, s as primitive data type. y cannot be accessed from out of its class.
The default constructor is initializing x to 0 and y to 0 too.
Overload the default constructor with z integer argument; assign the z value to the x value.
Write method m1 that has no body;
Write method m2 that cannot be override. This method returns the power 2 of x value.
Write method m3 that has no arguments, it just assign 5 to s, and returns s.
In side the main method initialize the s data type to = zero, then call m3 and println s.


ولكم مني جزيل الشكر والامتنان