Question: what is displayed by the following code segment? public class Book { private double cost, retail; private boolean fiction; private void setRetail ( ) {
what is displayed by the following code segment?
public class Book
private double cost, retail;
private boolean fiction;
private void setRetail
iffiction
retail cost ;
else
retail cost ;
public Bookdouble c boolean f
cost c;
fiction f;
retail cost;
public double getRetail
setRetail;
return retail;
public static void mainString args
Book myBook new Book true;
System.out.printlnmyBookgetRetail;
a
b
c
d none of these
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
