0% found this document useful (0 votes)
2 views

Book Java

The document defines a Java class named 'Book' within the 'com.bookshop.model' package. It includes private fields for book attributes such as id, title, author, price, and image, along with corresponding getters and setters for each field. This structure allows for the encapsulation and management of book-related data in a bookshop application.

Uploaded by

haryzao03
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Book Java

The document defines a Java class named 'Book' within the 'com.bookshop.model' package. It includes private fields for book attributes such as id, title, author, price, and image, along with corresponding getters and setters for each field. This structure allows for the encapsulation and management of book-related data in a bookshop application.

Uploaded by

haryzao03
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

package com.bookshop.

model;

public class Book {

private int id;


private String title;
private String author;
private double price;
private String image; // Image URL or file path

// Getters and Setters for each field


public int getId() {
return id;
}

public void setId(int id) {


this.id = id;
}

public String getTitle() {


return title;
}

public void setTitle(String title) {


this.title = title;
}

public String getAuthor() {


return author;
}

public void setAuthor(String author) {


this.author = author;
}

public double getPrice() {


return price;
}

public void setPrice(double price) {


this.price = price;
}

public String getImage() {


return image;
}

public void setImage(String image) {


this.image = image;
}
}

You might also like