class Book { private String bookId; private String title; private int pages; private String authors; public Book(String pBookId, String pTitle) { bookId=pBookId; title=pTitle; } public void setTitle(String pTitle){ title=pTitle; } public void setPages(int pPages) { pages=pPages; } public void setAuthors(String pAuthors) { authors=pAuthors; } public String getBook() { return (bookId +":"+ title + ":" + pages); } } class Student { private String studentId; private String studentName; private String address; private int age; public Student(String pStudentId, String pStudentName) { studentId=pStudentId; studentName=pStudentName; } public void setStudentName(String pStudentName) { studentName=pStudentName; } public void setAddress(String pAddress) { address=pAddress; } public void setAge(int pAge) {age=pAge;} public String getStudent() { return (studentId + ":" + studentName + ":" + address + ":" + age); } } public class ex3Prog { private Book bk1,bk2,bk3; private Student stu1,stu2,stu3; public ex3Prog() { bk1=new Book("CS001","Intro. to Computer"); displayBook(bk1); bk1.setAuthors("John"); bk1.setPages(200); displayBook(bk1); stu1=new Student("44111315","Mr.Mongkhon"); displayStudent(stu1); stu1.setAddress("Narita,Tokyo"); stu1.setAge(19); displayStudent(stu1); } private void displayBook(Book pBook){ System.out.println(pBook. getBook()); } private void displayStudent(Student pStudent) { System.out.println(pStudent.getStudent()); } private static void main(String[] args) { ex3Prog e3=new ex3Prog(); } }