Given:
class Book {
int id;
String name;
public Book (int id, String name) {
this.id = id;
this.name = name;
}
public boolean equals (Object obj) { //line n1
boolean output = false;
Book b = (Book) obj;
if (this.name.equals(b name))}
output = true;
}
return output;
}
}
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?
M_Jawad
Highly Voted 4 years, 11 months agoasdfjhfgjuaDCV
Most Recent 9 months, 4 weeks agosteefaand
10 months, 3 weeks agoduydn
1 year, 3 months agor1muka5
1 year, 10 months agoSvetleto13
3 years, 8 months ago