Which statement is true?

Given:


and the code fragment:
Book b1 = new Book (101, “Java Programing”);
Book b2 = new Book (102, “Java Programing”);
System.out.println (b1.equals(b2)); //line n2
Which statement is true?
A. The program prints true.
B. The program prints false.
C. A compilation error occurs. To ensure successful compilation, replace line n1 with:
boolean equals (Book obj) {
D. A compilation error occurs. To ensure successful compilation, replace line n2 with:
System.out.println (b1.equals((Object) b2));

Download Printable PDF. VALID exam to help you PASS.

4 thoughts on “Which statement is true?

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.