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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:48:04+00:00 2026-05-16T11:48:04+00:00

The dictionary use strict equals(===) for key comparison, how to change the comparison, so

  • 0

The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:

    class Student{
     var id:int;
     var name:String;
     var age:int;
    //constructor
   Student(id:int,name:String,age:int){
         this.id = id;
         this.name = name;
         this.age = age;
      }
    }

I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.

  • 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-16T11:48:05+00:00Added an answer on May 16, 2026 at 11:48 am

    you can do next:

    class Student{
     var id:int;
     var name:String;
     var age:int;
    Student(id:int,name:String,age:int){
         this.id = id;
         this.name = name;
         this.age = age;
      }
        public function equals(s:Student):Boolean{
            return ((this.id==s.id)&&(this.name==s.name)&&(this.age==s.age));
        }
    }
    

    so later use it like:

    var d:Dictionary=new Dictionary();
    d["key"]=new Student();
    //snippet
    (d["key"] as Student).equals(new Student());
    

    also if you want to overload as3 operators read next things:

    Overload [] operator in AS3
    http://livedocs.adobe.com/flex/3/langref/flash/utils/Proxy.html

    Best Regards
    Eugene

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

Sidebar

Related Questions

I can't use TryGetValue() from dictionary in linq expression with anonymous type. Dictionary<string, string>
In Python I can use get method to get value from an dictionary without
Dictionary cannot have two values with same key. please tell which logic/algorithm being used
How to write this in C #? Can you use Dictionary to this? $count
When I define a dictionary which use list as key collections.defaultdict(list) When I print
In my class, I want to use a dictionary with the following declaration: Dictionary<string,
My need is to have items in kind of Collections.Generic.Dictionary where I can get
I often use Dictionary in C#2.0 with the first key as string that was
In C#, the Dictionary class takes a single key and maps it to a
I have a dictionary that goes like this: typedef struct dictNode { int key;

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.