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 580805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:30:43+00:00 2026-05-13T14:30:43+00:00

Firstly it is not an exception since it is part of the normal flow

  • 0

Firstly it is not an exception since it is part of the normal flow of operations. I tried to return a null object but this was not allowed. I can get by returning a Point with negative coordinates but it feels like a hack. For example if I return (-1, -1) then instead of checking for a negative number, conceivably some use of my library might directly check for equality with -1 which will then break if my internal implementation changes

  • 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-13T14:30:44+00:00Added an answer on May 13, 2026 at 2:30 pm

    You could return a nullable Point by changing your return type to Point?. That way you can also return null.

    Otherwise you can create a static Point instance somewhere with (−1, −1) and always compare against that. PointUtils.InvalidPoint is probably nicer to read than p.x == -1 && p.y == -1.

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

Sidebar

Related Questions

Firstly I tried fiding some similar posts but could not quite find anything. Mainly
Ok, firstly this is not about forms this is about consistent layout as a
Firstly, I do not have any malicious intent out of this question. I would
Firstly this is not a homework question. I am practicing my knowledge on java.
Firstly, I'm not asking how to perform a multi-file upload using CodeIgniter, but rather
Ok firstly, this is not a discussion on whether I should be catering for
firstly bear with me this might not come out the way i intend it
Firstly I feel this question is not a duplicate for : Easiest implementation of
Firstly there is an almost identical question but the answer is not really satisfactory.
Firstly, i am sorry if the title does not properly describe my problem, but

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.