-2

I've seen an Android project structure in the image below. What does "Bean" mean in this structure? or Why does that folder name "Bean"?

enter image description here

duy hoang
  • 59
  • 8

1 Answers1

4

Bean in java is basically a single class encapsulate many objects into a single object and there properties can be manipulated by using getter and setter method.We also call it model class. The below code snippet is an example of bean class.

    public class Book implements Serializable{
        private String isbn;
        private String title;
        private String author;
        private String publisher;
        private int pages;
        /**
         * Default constructor
         */
        public Book() {
            this.isbn = "";
            this.title = "";
            this.author = "";
            this.publisher = "";
            this.pages = 0;
        }
        public String getIsbn() {
            return isbn;
        }
        public void setIsbn(final String isbn) {
            this.isbn = isbn;
        }
        public String getTitle() {
            return title;
        }
        public void setTitle(final String title) {
            this.title = title;
        }
        public String getAuthor() {
            return author;
        }
        public void setAuthor(final String author) {
            this.author = author;
        }
        public String getPublisher() {
            return publisher;
        }
        public void setPublisher(final String publisher) {
            this.publisher = publisher;
        }
        public int getPages() {
            return pages;
        }
        public void setPages(final int pages) {
            this.pages = pages;
 }
}

In your case i think the package you pointed contained all the bean classes

Abhijit Chakra
  • 3,201
  • 37
  • 66