Buffl

java

En
by EYAD N.

Folder 1

package eyad;

package eyad;

public class main {

public static void main(String[] args) {


Book myBook = new Book();

myBook.displayBookInfo(" OOP java", "eyad", "9780446310789");


System.out.println("-------------------------");


Book myBook2 = new Book();

myBook2.title="OOP java";

myBook2.author="eyad";

myBook2.isbn="9780446310789";

myBook2.text();

}}


}}

Folder 2

package eyad;

public class Book {

String title;

String author;

String isbn;

public void displayBookInfo(String title, String author, String isbn) {


System.out.println("Book Details:");


System.out.println("Title: " + title);


System.out.println("Author: " + author);


System.out.println("ISBN: " + isbn);


}

public void text () {


System.out.println("Book Details:");


System.out.println("logo: " + title);


System.out.println("name: " + author);


System.out.println("id: " + isbn);

}}

THE OUTPUT WILL BE

Book Details:

Title: OOP java

Author: eyad

ISBN: 9780446310789

-------------------------

Book Details:

logo: OOP java

name: eyad

id: 9780446310789

——————————————————————————————————————

——————————————————————————————————————

folder 1

package eyad;

public class main {

public static void main(String[] args) {


Book myBook = new Book(" OOP java", "eyad", "9780446310789");


myBook.author="eyad";

myBook.displayBookInfo();

}}

folder 2

package eyad;

public class Book {

// Instance variables (attributes) of the Book

String title;

String author;

String isbn;

// Constructor to initialize the Book object

public Book(String title, String author, String isbn) {

this.title = title;

this.author = author;

this.isbn = isbn;

}

// Method to display book information

public void displayBookInfo() {

System.out.println("Book Details:");

System.out.println("Title: " + title);

System.out.println("Author: " + author);

System.out.println("ISBN: " + isbn);

}}

THE OUTPUT WILL BE

Book Details:

Title: OOP java

Author: eyad

ISBN: 9780446310789


Author

EYAD N.

Information

Last changed