مثال2 على البرمجة الغرضية التوجه في جافا java object oriented | library books system
-
2020-12-04
- | daafoor
- | مشاهدات: 831
مثال بسيط على البرمجة الكائنية في جافا
object oriented example in java
class Book {
private String name;
Author authors[];
private double price;
private int qty ;
public Book(String name,Author authors[],double price,int qty){
this.name=name;
this.authors=authors;
this.price=price;
this.qty=qty;
}
public String getName(){
return name;
}
public Author[] getAuthors(){
return authors;
}
public double getPrice(){
return price;
}
public int getQty(){
return qty;
}
public void setName(String name){
this.name=name;
}
public void setPrice(double price){
this.price=price;
}
public void setQty(int qty){
this.qty=qty;
}
public void setAuthors(Author authors[]){
this.authors=authors;
}
public String toString()
{
String authors_list="";
for(int i =0;i
التعليقات
لا يوجد تعليقات
لاضافة سؤال او تعليق على المشاركة يتوجب عليك تسجيل الدخول
تسجيل الدخول
تسجيل الدخول