السلام عليكم ورحمة الله وبركاته
الصراحة اخواني انا مبتدا جدا في لغة الجافا وطلب منا دكتور في الجامعة اسيمنت
انو
write a class named Point that include two integer fields x and y and the following methods...
1. a constructor with no parameters that set both x=y=0
2. a constructor with one parameter a that sets x=y=a
3. a constructor with two parameters a,b that sets x=a and y=b
4. two get methods to return x and y
5. two set methods to set a new values to x and y
6. getLocation method which return a string of the location of the point
after that build a main method in which Creat three points from the three different constructors and print out its x-y values and location
احنا نستخدم بالجامعة برنامج netbeans
وانا في بعض محاضرات ما حضرتها لظروف خاصة جدا حصلت معي
بتمنى الي بفهم السؤال يشرحلي اياه بشكل بسيط وبتمنى مساعدتي لكتابة البرنامج كامل
انا كتبت هادا الكود في كلاس اسمو Point
public class Point {
int x,y;
/** Creates a new instance of Point */
public Point() {
x=y=0;
}
public Point(int a) {
x=y=a;
}
public Point(int a, int b) {
x=a;
y=b;
}
public Integer getX() {
return x;
}
public Integer getY() {
return y;
}
public void setX(int xx) {
this.x = xx;
}
public void setY(int yy) {
this.y = yy;
}
public Point getLocation() {
return new Point(x, y);
}
}
لكن مش عارف كيف اكمل باقي البرنامج
تسليم الاسيمنت بعد يومين احتاج مساعدة عاجلة ضروري اخواني
حياكم الله مقدما

