From the javadoc:
The Dimension class encapsulates the width and height of a component
(in integer precision)
Why not represent these as an int or long?
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.
I reckon it is because the superclass, Dimension2D, declares the method to return a double. For most solutions an integer is fine, but when you wish to create a Dimension2D type for vector graphics, returning dimensions as something else than integers would be necessary.