Classes & Objects
Lesson 26Author : GOUP
Last Updated : September, 2020
public class App { public static void main(String [] args) { Book book1 = new Book(); book1.title = "Harry Potter"; book1.author = "JK Rowling"; book1.numPages = 400;
System.out.println(book1.title);
Book book2 = new Book();
book2.title = "Lord of the Rings";
book2.author = "JRR Tolkien";
book2.numPages = 300;
System.out.println(book2.title);
}
}