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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:17:48+00:00 2026-05-22T23:17:48+00:00

I have a form that let user enter values about address information. I want

  • 0

I have a form that let user enter values about address information.
I want to compare the values I get from user, with information stored into ADDRESS table in the database.
I have an entity class

public class Address {
  private String gevernate;
  private int homeNo;
  private String neighborhood;
  private String street;
} 

which is represented as a table in the database called ADDRESS.

and I have a view object for this class which return all address values from db tabel

public static Address getAddress(Connection Con, long stdID) {
// select stamatment and result set object.
}

The problem I face is that the form may NOT contain all values of Address object, it may contains only 2 or three values, it’s specified at run time. How can I compare two objects ?

  • 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-22T23:17:48+00:00Added an answer on May 22, 2026 at 11:17 pm

    add an equals method to the class like this:

    public class Address {
        private String gevernate;
        private int homeNo;
        private String neighborhood;
        private String street;
    
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Address other = (Address) obj;
        if (gevernate == null) {
            if (other.gevernate != null)
                return false;
        } else if (!gevernate.equals(other.gevernate))
            return false;
        if (homeNo != other.homeNo)
            return false;
        if (neighborhood == null) {
            if (other.neighborhood != null)
                return false;
        } else if (!neighborhood.equals(other.neighborhood))
            return false;
        if (street == null) {
            if (other.street != null)
                return false;
        } else if (!street.equals(other.street))
            return false;
        return true;
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say that I have a form which runs a stored procedure. This stored
I'm having a form in a .erb file, where the user can enter some
Let's say I have a form_tag in a view gathering a view user input
I have a form on a website that needs validating before entering the form
I currently have a simple app that includes user authentication through devise and a
On a page, something like jsFiddle, that executes user inputed Javascript, is there a
I have an input text field that needs to be limited as to what
I have an iframe Facebook application (using Facebook's new JavaScript API) that needs to
i have two tables which form part of my login/register system: these are userlogin
I have two aspx files for adding/deleting products to/from a sale. islemler.aspx SatisTedarik.aspx I

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.