Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5944901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:36:21+00:00 2026-05-22T16:36:21+00:00

Both x and y and integers, while getX() and getY() returns a doubles. Why

  • 0

Both x and y and integers, while getX() and getY() returns a doubles.

Why aren’t there e.g. getXIntValue(), getXDoubleValue() and vice versa for y?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:36:22+00:00Added an answer on May 22, 2026 at 4:36 pm

    As others have said, it’s because it’s ancient. But I like it because it saves typing and adds clarity; IMHO getters and setters can be a waste of time for simple classes if they’re public and all they’re going to do is to return the value and set it, which is all you want 99% of the time.

    Design philosophy changed and now everything uses them. But things are coming full circle and in a modern languages like Groovy these would be “properties” with getters / setters inferred and syntax pretty similar to that for accessing public fields in Java.

    E.g. http://groovy.codehaus.org/Groovy+Beans

    Edit: and according to an (unofficial) Scala style guide,

    Note that fields may actually be used in a number of situations where accessors and
    mutators would be required in languages like Java. Always prefer fields over methods
    when given the choice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My query returns two days, say the 10th and the 11th, both just integers.
I'm looking for an algorithm which can take two sets of integers (both positive
Both ideas sound very similar to me, but there might be subtle differences or
Basically, I have been using both Integer.Parse and CInt in most of my daily
Are all final classes in Java immutable. String and Integer both are final classes
Both the jQuery and Prototpye JavaScript libraries refuse to allow me to use a
Both are mathematical values, however the float does have more precision. Is that the
Both DataSource and DataSourceID are defined on 'grdCommunication'. Remove one definition. I just got
Both of them are mbeans. Both are intended to setup Hibernate Session Factory and
Both Session.Clear() and Session.Abandon() get rid of session variables. As I understand it, Abandon()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.