BookShelf - hardback3.name="Big...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class BookShelf p { public String name; public int page; public static void main(String[]args) { BookShelf hardback=new BookShelf(); hardback.name="Building Java Programs"; hardback.page=871; h BookShelf hardback2=new BookShelf(); hardback2.name="Java in a Nutshell"; hardback2.page=267; h BookShelf hardback3=new BookShelf();
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: hardback3.name="Big Java"; hardback3.page=782; h System.out.println("The book " +hardback.name+ " has "+hardback.page+" pages"); System.out.println("The book " +hardback2.name+ " has "+hardback2.page+" pages"); System.out.println("The book " +hardback3.name+ " has "+hardback3.page+" pages"); p } }...
View Full Document

Ask a homework question - tutors are online