Assume class Book has been declared. Which set of statements creates an array of Books?
a.
Book[] books;
books = new Book[numberElements];
b.
Book[] books];
books = new Book()[numberElements];
c.
new Book() books[];
books = new Book[numberElements];
d. All of the above.
Ans: a.
Book[] books;
books = new Book[numberElements];
7.6 Q3: How many Book objects are created by the following statement?
Book[] books = new Book[10];
a. 10
b. 0
c. 5
d. None of the above.
b. 0. The statement creates an array of element that can refer to Book objects. Each element is initially null.
You might also like to view...
Credit sources referred to as ________ are placed at the bottom of the page.
a. citations b. endnotes c. pages d. footnotes
Text filters allow you to create a custom filter to match only all of the text in a field that you specify
Indicate whether the statement is true or false