Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817
Moderator: admin
-
hornbillpython
- Posts: 1
- Joined: Mon Nov 11, 2024 10:01 pm
-
Contact:
Post
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?
Last edited by
admin on Tue Nov 12, 2024 12:20 am, edited 1 time in total.
Reason: Please put code inside [code] [/code]
-
admin
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
-
Contact:
Post
by admin »
For boolean properties, JavaBeans convention allows both - is as well as get.
Users browsing this forum: Bing [Bot] and 16 guests