Page 1 of 1

About question com.enthuware.ets.scjp.v6.2.13

Posted: Mon Nov 11, 2024 10:34 pm
by hornbillpython

Code: Select all

public class Bond
{
public String ticker;
private double Coupon;

public String getTicker()
{
return ticker;
}

public void setTicker(String ticker)
{
this.ticker = ticker;
}

public double getCoupon()
{
return Coupon;
}

public void setCoupon(double coupon)
{
//do nothing
}

public java.util.Date getMaturity()
{
return new java.util.Date();
}

public boolean isFloater(){ return false; }

public boolean getCallable(){ return true;[size=1][url=https://googlebaseball.io]google baseball[/url][/size] }

}
I thought the JavaBean naming convention for boolean retrieval was isCallable not as the answer states getCallable().

What do others think?

Re: About question com.enthuware.ets.scjp.v6.2.13

Posted: Tue Nov 12, 2024 12:21 am
by admin
For boolean properties, JavaBeans convention allows both - is as well as get.