[RESOLVED] Declare a const float
We're using NetBeans in my Java class and I'm wondering why this wont compile:
Code:
public class LoanClass {
const float HOUSE_15YR = 1.2;
const float HOUSE_30YR = 1.2;
}
NetBeans is telling me that there's a loss of data and that I should change the 'float' to a 'double' and when I do that it still wont compile because it's an illegal start of type. What does that mean?
All I need is a float that's a constant.
Re: Declare a const float
Use 'static final' instead of 'const'.
('const' is a keyword in Java, but it's currently unused).
Re: Declare a const float
Thanks, I did eventually find a page via google that said that.