What is the data type for the number 9.6352 in Java?
Actually if I postfix the number with ‘d’ or ‘f’. then it will be quite easy to decide.
But if I leave it as alone, then which will be the default type of the number in java?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Go check out the JLS section on floating point literals (§3.10.2):
So it’s a double if it’s not suffixed.