About hashCode() function..

What is the use of hashCode() function.
It is in both String and Hashtable classes...
What is the necessity having same function in both classes..
What actually it returns...
Can we use it with any type objects?

I hope everybody know that java have special
treatment for Strings.
int hash1 = "ABCDEa123abc".hashCode();
int hash2 = "ABCDFB123abc".hashCode();Both the time the string used "ABCDEa123abc" will
have the same reference. You are trying to make a valid point, but you missed the fact that those two strings are not equal, but produce the same hashCode(). This happens, because you are mapping a large value space (Strings) to a much smaller space (int).
It's used to demonstrate that you must not depend on the hashCode beeing unique.
>
Thats why u always get the same hashcode.

Similar Messages

  • HashCode function in Object class.

    Hi! to all!
    I have got a confusion about hashCode function of Object class, which returns an integer.
    What is the real purpose of introducing this method in Object class.
    Please comment.

    hashCode() method of the object is intorduced for the benefit of collections like HashTables. Typically
    hashCode method should return distinct integers for distinct objects which are decided distinct based on
    equals method of the object. Though this is not mandatory , if distinct objects have distinct
    hashCodes, it will improve the performance of HashTables.A good distribution of hash codes will indeed help in the performance of a HashMap or Hashtable. However, by definition, hashcodes are not necessarily distinct for objects that are distinct based on equals. Two objects for which "equals" is true should have the same hashcode, but two objects which have the same hashcode don't have to have "equals" be true. There is a limited number of hashcodes (the range of int), but an unlimited number of objects. So, some objects will necessarily have the same hashcode. The pigeonhole principle describes this situation:
    http://en.wikipedia.org/wiki/Pigeonhole_principle

  • Documentation about this function module

    ineed Documentation about this function module RP_ANSAL_FROM_PERNR

    Hi Avinash,
    Have a look at the function group program documentation.It gives an idea of what the function module does.
    Short text
    Annual Salary Functionality (ANSAL)
    Description
    This function group contains different functionality for calculating the annual salary, and calculating a period salary from the annual salary.
    The function group evaluates different tables and features:
    Tables
    T503      defines whether an employee is paid on an
              hourly basis or per period
    T510W     defines the time unit
    T511      determines the relevant module from the annual
              salary wage type, rounding, etc.
    T539J     defines the valid wage types for calculating 
              the annual salary
    Features
    ANSAL     defines the annual salary wage type
    PFREQ     number of periods per year
    Old U510F -> use T510F ?
    Thanks
    Lakshman

  • NEED INFORMATION ABOUT "MAX_TEST" FUNCTION MODULE

    HI ABAPERS,
                      I need information about "MAX_TEST" function module . this function module is used in 4.6 version , now system have been shifted to 6.0.....here in 6.0 version this function module is not prasent.can any one tell me which new function module we can use in place of this function module, without changing the functionality........
             Thanks in advance
    regards,
    SUNIL

    The module is not very sophisticated. Profficiency in Java or ABAP will be a great bonus here. There are plenty of good materials regarding XI on SDN. I suggest to start with step-by-step guides and master all basic integration scenarios
    http://wiki.sdn.sap.com/wiki/display/XI/Step-by-Step+Guides
    Opportunities in industry are not bad also, cause PI is rather popular among customers. The best thing is that it fits any type of customer's business. Integration is demanded almost everywhere.

  • About CallByteMethodA Function

    Hi you all:
    I have some problem about CallByteMethodA function.
    This is what my java code looks like:
    public void setDS_INFO_mac(byte[] mac) {
    for( int i = 0; i < mac.length; ++i ) {
    this.ds_info.mac[i] = mac;
    This is what my c code looks like:
    jobject objref;
    jclass cls = NULL;
    jfieldID fid = NULL;
    jmethodID mid = NULL;
    jbyte dsMac[6];
    jbyteArray returnArray = 0;
    /* code not pertaining to this question snipped. */
    mid = env->GetMethodID(cls, "setDS_INFO_mac", "([B)V" );
      for( int j = 0; j < 6; ++j ) {
          dsMac[j] = search_Info[i].ds_info.mac[j];
    returnArray = env->NewByteArray(6);
    if( returnArray != NULL ) {
    env->SetByteArrayRegion(returnArray, 0, 6, (jbyte*)dsMac);
    env->CallByteMethodA(objref, mid, (jvalue*)returnArray);
    env->DeleteLocalRef(returnArray);
    This is not working.
    and, some about run time exception as follows:
    Exception in thread "main" java.lang.NullPointerException
    at CFGINFO.setDS_INFO_mac(DSCIStructure.java:97)
    at DSCIJNInterface.dsc_EnumSearch(Native Method)
    at MainApp.searching(MainApp.java:105)
    at MainApp.main(MainApp.java:46)
    Any idea what I'm doing wrong?

    You are missing error checking code. Many calls to the JNI interface require that you check the method return value. Many calls also require that java exceptions must be checked for after the call.

  • Description about a function module O2_LANGUAGE_EXIT_FUNCTION

    Hi All,
    i want to know the description about the function module 'O2_LANGUAGE_EXIT_FUNCTION'. Please explain what is the functionality of this function module clearly.
    Thanks & Regards,
    Nagarjuna.

    hi,
    send me ur mail id ,
    i will send the pay roll related function moduls.
    and document relataed to pay roll.
    ramesh

  • System table that stores info about any function module

    Hi All,
    I know that table TFDIR stores primary information about any function module.
    Could anyone tell me where the code of that function module gets stored in?
    Also.. If I want to write an ABAP code to read the function module code then what is the best possible solution?
    I want to read a function module code if that contains specific string.
    Can anyone help me  with that?
    Thanks in advace and any answer will be appreciated.
    Regards
    Jignesh
    Edited by: Jignesh Patel on Jun 12, 2008 12:22 PM

    Hi Jignseh,
    The codes are not stored in any table, they are stored as cluster.
    To read the code, you can use READ REPORT.
    But there you must provide the Include Name
    For Example , If you want to read the code of READ_TEXT,
    READ REPORT 'LSTXDU01'.
    You can get this include name inside include LSTXDUXX
    Use "GET_INCLUDES" to get all include names
    Edited by: Swastik Bharati on Jun 12, 2008 12:28 PM

  • Can anybody tell me about SD Functionality and the main tables used in SD

    Hi,
    Can anybody tell me about SD Functionality and the main tables used in SD.
    Thanks,
    bsv.

    Hi
    SD FLOW
    SD Flow Cycle:
    INQUIRY ( VA11)
    |
    QUOTATION (VA21)
    |
    PURCHASE ORDER (ME21)
    |
    ORDER CONFIRMATION (VA01)
    |
    PICKING LIST – (VL36)
    |
    PACKING LIST - (VL02, VL01)
    |
    SHIPPING – (VT01)
    |
    INVOICE – (VF21, VF01)
    |
    AR
    Enquiry - Customer enquires about the Products services that were sold by a company - VA11
    Quotation - Company Gives a Quotation for the products and Services to a Customer
    Sales Order - Customer gives a Purchase order to the company agaionst which a Sales order will be raised to Customer in SAP.
    VBAK: Sales Document(Header Data) (VBELN)
    VBAP: Sales Document(Item Data) (VBELN,POSNR,MATNR,ARKTX,CHARG)
          Enquiry, Quotation, Sales Order are differentiated based on Doc.
          Type(VBTYP field) in VBAK,VBAP Tables( for Enquiry VBTYP = A,
          for Quotation 'B' & for Order it is 'C'.)
    Delivery(Picking, Packing, Post Goods Issue and Shipment)->
    Company sends the material after picking it from Godown and Packing it in a Handling Unit(box) and Issues the goods
    LIKP: Delivery Table (Header Data)(VBELN,LFART,KUNNR,WADAT,INCO1)
    LIPS: Delivery Table (Item Data)(VBELN,POSNR,WERKS,LGORT,MATNR,VGBEL)
          (LIPS-VGBEL = VBAK-VBELN, LIPS-VGPOS = VBAP-POSNR)
    Billing - Also company bills to the customer for those deliveries
    And in FI against this billing  Accounting doc is created.
    VBRK: Billing Table(Header Data)(VBELN,FKART,BELNR)
    VBRP: Billing Table(Item Data)(VBELN,POSNR,FKIMG,NETWR,VGBEL,VGPOS)
          (VBRP-AUBEL = VBAK-VBELN, VBRP-VGBEL = LIKP-VBELN)
          Apart from these tables there are lot of other tables which starts with
          ‘V’, but we use the following tables frequently.
    other tables and imp fields
    VBUK: All Sales Documents status & Admn. Data(Header)(VBELN,VBTYP)
          VBTYP= ‘C’(Sales Order) VBTYP=’J’(Delivery) VBTYP=’M’(Invoice) 
    VBUP: Sales Documents status & Admn. Data(Item)(VBELN,POSNR)
    VBEP: Sales Doc. Schedule Lines Data(VBELN,POSNR,EDATU,WMENG)
    VBKD: To get sales related Business data like Payment terms etc.(VBELN,ZTERM)
    VBFA: sales document flow data(VBELV,VBELN,POSNV,VBTYP)
    VBPA: Partner functions Data(VBELN,PARVW,KUNNR,LIFNR)
    VEDA: Contract Data(VBELN,VPOSN)
    VEDAPO: Contract Data(VBELN,VPOSN)
    KONA:  Rebate Agreements (KNUMA,VKORG,VTWEG,SPART)
    VBRL:  SD Document: Invoice List(VBELN,POSNR,VBELN_VF,NETWR,KUNAG)
    VKDFS: SD Index: Billing Indicator(FKTYP,VBELN,FKART,VKORG)
    VBSK:  Collective Processing for a Sales Document Header(SAMMG,SMART)
    VBSS:  Collective Processing: Sales Documents(SAMMG,VBELN,SORTF)
    VRKPA: Sales Index: Bills by Partner Functions(VBELN,BELNR,KUNDE,PARVW)
    VRPMA: SD Index: Billing Items per Material(MATNR,VBELN,BELNR,KUNNR)
    TVLKT: Delivery Type: Texts(LFART,VTEXT)
    KNA1: Customer Master-General(KUNNR,NAME1,LAND1)
    KNB1: Customer Master(Company Code)(KUNNR,BUKRS,PERNR)
    KNC1: Customer Master Data (Transaction Figures)(KUNNR,BUKRS,GJAHR)
    KNVK: Customer Master Contact Partner(PARNR,KUNNR,NAME1)
    KNVV: Customer Master sales data(KUNNR,VKORG,VTWEG,KDGRP)
    KNBK: Customer Bank Details(KUNNR,BANKS,BANKL,BANKN)
    KNVH: Customer Hierarchy (HITYP,KUNNR,VKORG,VTWEG,SPART)
    KNVP: Customer Master Partner Functions(KUNNR,PARVW,KUNN2)
    KNVS: Customer Shipment data(KUNNR,VSTEL,TRANS)
    KNVI: Customer Tax data(KUNNR,ALAND,TATYP)
    LFA1: Vendor Master-General (LIFNR,NAME1,ORT01)
    LFB1: Vendor Master(Company Code)(LIFNR,BUKRS,PERNR)
    LFC1: Vendor Master (Transaction Figures)(LIFNR,BUKRS,GJAHR)
    MARA: Material Master-General (MATNR,MTART,MATKL)
    MARC: Material Master-Plant data(MATNR,WERKS,EKGRP)
    MARD: Material Master- St.Location Data(MATNR,WERKS,LGORT,LABST)
    EBEW:  Sales Order Stock Valuation(MATNR,VBELN,BWKEY,BWTAR)
    TVKO:  Sales Organizations(VKORG)
    TVTW:  Distribution Channel(VTWEG)
    TSPA:  Divisions(SPART)
    TVKOV: Distribution Channels for S.Orgn(VKORG,VTWEG)
    TVKOS: Divisions for S.Orgn(VKORG,SPART)
    TVTA:  Sales Areas(VKORG,VTWEG,SPART)
    TVBUR: Sales Offices(VKBUR,ADRNR)
    TVKBT: Sales Office Texts(VKBUR,SPRAS,BEZEI)
    TVKBZ: Sales Office Assign.to Sales Area(VKORG,VTWEG,VKBUR)
    TVKGR: Sales Group(VKGRP)
    TVGRT: Sales Group Texts(VKGRP,SPRAS,BEZEI)
    TVBVK: Sales Group to Sales office(VKBUR,VKGRP)
    TVKWZ: Plants Assign.to S.Orgn(WERKS,VKORG)
    T171T: Sales District Texts(BZIRK,BZTXT,SPRAS)
    TVLA:  Loading Points(LSTEL)
    TVST:  Shipping Points (VSTEL)
    TVSWZ: Shipping Point to Plant(VSTEL,WERKS)
    TVPT:  Item Categories (PSTYV)
    TINC:  Customer Incoterms(INCO1)
    T077D: Customer Account Group (KTOKD)
    T001W: Plants (WERKS)
    T001L: Storage Locations (LGORT)
    T499S: Locations(WERKS,STAND,KTEXT)
    TWLAD: To get address of Storage Location and Plant(LGORT,ADRNR)
    TVAK:  Sales Document (Order) Types (AUART)
    TVAU:  Sales Documents: Order Reasons (AUGRU)
    TVFK:  Billing Document Types (FKART)
    TVLK:  Delivery Types(LFART)
    TVSB:  Shipping Conditions (VSBED)
    TTDS:  Transportation Points(TPLST)
    TVKT:  Account Assignment Groups (KTGRD)
    KONV:  Condition Types pricing)(KNUMV,KSCHL,KWETR)
    ADRC:  To get Addresses of Partners(ADDRNUMBER,NAME1)
    VBBE:  Sales Requirements: Individual records(VBELN,POSNR,MATNR)
    VBBS:  Sales Requirement totals Record(MATNR,WERKS,LGORT,CHARG)
    VBKA:  Sales Activities Data(VBELN,KTAAR)
    VBPV:  Sales Document Product Proposal(VTWEG,MATNR,KUNNR,CHARG)
    T682:  Access Sequences (KOZGF)
    T682T: Access Sequence Texts (KOZGF,VTXTM)
    T683:  Pricing Procedures (KALSM)
    T683T: Pricing Procedures Texts(KALSM,KAPPL,SPRAS,VTEXT)
    T685:  Pricing Condition Types (KSCHL)
    T685T: Condition Type Texts(KSCHL,SPRAS,KAPPL,VTEXT)
    KONH:  Conditions (Header)(KNUMH,KAPPL,KSCHL)
    KONP:  Conditions (Item)(KNUMH,KOPOS,KAPPL,KSCHL)
    KONV:  Conditions (Transaction Data)(KNUMV,KSCHL,KBERT,KWERT)
    KOND:  Conditions (KNUMD,ZUSKO,KSCHL)
    for sd go through the links
    http://www.sapgenie.com/abap/tables_sd.htm
    Please check this SD online documents.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CAARCSD/CAARCSD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MYSAP/SR_SD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMSD/BCBMTWFMSD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LOLISPLN/LOLISPLN.pdf
    Also please check this SD links as well.
    http://help.sap.com/saphelp_47x200/helpdata/en/92/df293581dc1f79e10000009b38f889/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/dd/55f33e545a11d1a7020000e829fd11/frameset.htm
    http://www.sap-basis-abap.com/sapsd.htm
    http://www.sap-img.com/sap-sd.htm
    http://www.sapgenie.com/abap/tables_sd.htm
    http://searchsap.techtarget.com/featuredTopic/0,290042,sid21_gci961718,00.html
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/SD_tutorial.html
    All help ebooks are in PDF format here
    http://www.easymarketplace.de/online-pdfs.php
    Reward points if useful
    Regards
    Anji

  • Question about the function module (RFC_READ_TABLE)

    Dear everyone
    Could I ask you a question about the function module (RFC_READ_TABLE)?
    I was asked if it's possible to create a report which compares the data between different SAP systems (both production systems).
    Now, the easiest way would be to use the function module (RFC_READ_TABLE) within a SAP infoset query (SQ01 type query).
    But I heard the rumor that using the function module (RFC_READ_TABLE) is not advisable due to the security reason.
    However, I am not exactly sure what sort of security problems this function module can possibly have...
    Would you help me on this?
    I also would like to know if using "remote enabled module" type function module can always overcome this possible security issue.
    Or, are there any points that I need to be careful about even when I use "remote enabled module" function module?
    Thank you very much in advance.
    Takashi

    Dear Fred-san
    Thank you very much for your support on this.
    But, may I double check about what you mentioned above?
    So, what you were mentioning was that if some user executes the query with
    the function module (RFC_READ_TABLE), under the following conditions, he can access to
    the HR data even when he does not have the authorizations for HR transactions?
    <Conditions>
    1. the user has the authorization for HR database tables themselves
    2. RFC_READ_TABLE is called to retrieve the data from HR database
    <example>
    Data: LF_HR_TABLE like  DD02L-TABNAME value 'PA0000'.
    CALL FUNCTION 'RFC_READ_TABLE'
       EXPORTING
        query_table                = LF_HR_TABLE
      TABLES
       OPTIONS                    =
       fields                     =
       data                       =    .
    But then, as long as we call this function module for a non-critical tables such as
    VBAP (sales order) or EKKO (purchase order) within our query, it wouldn't seem to be
    so security risk to use RFC_READ_TABLE...
    Besides, each query (infoset query) has got the concept of user groups, which limits
    the access to the queries within the user group.
    ※If someone does not belong to the user group, he cannot execute the queries within that
       user group, etc
    So, my feeling is that even infoset queries does have authorization concept...
    Would you give me your thought on this?
    I also thank you for your information for SCU0.
    That is an interesting transaction
    Kind regards,
    Takashi

  • Oracle course to learn more about BI functions

    Hi,
    Do you know if there is any Oracle course specific about BI functions?
    Aggregate Functions
    Running Aggregate Functions
    String Functions
    Math Functions
    Calendar Date/Time Functions
    Conversion Functions
    System Functions
    Operators
    Expressions
    Literals
    I know how to build simple reports, but when it comes to use the above functions, I find it difficult.
    Maybe somebody can suggest a good book too?
    Thanks and Regards
    G.

    http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/b31770.pdf
    Page No 366 about Aggregated functions
    Running Aggregate Functions - 374
    String Functions - 378
    Math Functions - 384
    Calendar Date/Time Functions - 390
    Conversion Functions - 398
    System Functions - 402
    I Hope this works for you..

  • I want to know about Node functions

    can anyone explain with example about node functions in PI with an example as i am knew to PI

    Hi Chandra,
    Using google or SCN search you will find a lot of examples...
    https://www.google.es/search?q=SAP+PI+node+functions&ie=utf-8&oe=utf-8&rls=org.mozilla:es-ES:official&client=firefox-a&c…
    Redirecting...
    Try to read the SAP documentation and later ask to the forum if you have any doubt with a specif function and/or example. You would consider to research a bit before to ask because the question is so generic.
    Regards,

  • Where can i find clear information about sap function modules?

    where can i find clear information about sap function modules?
    for example,
    if i want to know whats the use of function module  "SAPGUI_PROGRESS_INDICATOR" .
    where i can find all the detail info..
    is there any sap transaction code for knowing about all function modules and there use?
    Regards
    Smitha

    Hi:
    For documentation, you have to find it out in se37 but it is not neccessary every Fm would have.
    Now question is about its used (if you know th e function module)-> go in se37-> put function module -> select where used list -> select used in like - program, class, BSP application etc -> click on ok; it would give the list of its used and just go in that find  how it is being used.
    if you have to find the function module for table - > go in se11 -> select table name -> click on where used list -> select function module  interface and click on ok, it would give the list of  its used.
    Otherwise go in g o o g l e dot  c o  m.
    Regards
    Shashi

  • How to implement hashCode() function

    Hello everybody
    I need to overrided hashCode method in my Object. This contains 4 attributes of type Long. I need to implement compatible hash code for my equals function.
    public class MyObject {
    Long attr1;
    Long attr2;
    Long attr3;
    Long attr4;
    public boolean equals(Object obj) {
    if (this == obj)
    return true;
    if (this == null || this.getClass() != obj.getClass())
    return false;
    TSCObject object = (TSCObject) obj;
    return (this.attr1 != null && this.attr1.equals(object) &&
    this.attr2 != null &&
    this.attr2.equals(object) &&
    this.attr3 != null && this.attr3.equals(object) &&
    this.attr4 != null &&
    this.attr4.equals(object));
    public int hachCode() {
    return 0;//??????????????
    Can somebody help me. I've heard something about HashCodeBuilder
    Thank

    It is hashCode(), not hachCode().
    You can consider to return the sum of the attr1.hashCode() + attr2.hashCode() + etc. You should try to "guarantee" as much as possible that the hashCode() returns an unique identifier of the MyObject in such a fast way so that it will improve performance of hashmaps/sets/tables which are used to store those objects. If you put a new MyObject in such a hashmap/set/table then it will check based on the hashcode if the object doesn't already exist. If it does, then it will invoke the equals() to check if they are certainly equal (which is generally more expensive).
    Also see http://java.sun.com/javase/6/docs/api/java/lang/Object.html#hashCode()

  • About Ipod Functions of Iphone on Pioner Car Kit

    Hello guys,
    I have a problem with my iphone about of Ipod functions. So, I have a car and there is Pioneer music kit (CD/USB/MP3 Player) on car. So, When I put my "ipod touch (2th generation and 3th generation)" to that, there is no problem, everything working, I can see playlist, play musics, change tracks, all of functions working on control of pioneer music kit. It's already should be like that and there isn't any abnormal situation.
    But;
    When I put my iphone to that kit, I never play and see my music, also the pionerr music kit haven't seen my phone like ipod touch. Also, I have checked with other iphone's but I have got same result every end of test.
    So, Do you have any information/experience or suggestions about that How can I solvbe that?
    Tested : Ipod Touch 2th. Generetion : Working
    Tested : Ipod Touch 3th. Generetion : Working
    Tested : Iphone 3G : Not Working
    Tested : Iphone 3GS : Not Working
    I haven't test with Iphone 4 until now because I don't have
    Note : All of test has been done by USB connection!

    keep taking it on and of the usb until a message appears then press play and leave for a few seconds- that used to work for mine b4 it broke. hope that helps

  • Need to disable the clearing of browsing history and what is the "about:config" function for it?

    I am working on an Group Policy Administrative template for Wetdog.exe, and it's awesome by the way. Just want to know what function to use (listed in "about:config" url) so i can turn this feature off entirely.
    I don't want my users deleting browsing history, or have any ability to view it either.
    Still, i want the browser to keep at least 30 days of history.
    This is EASILY accomplished in Internet Explorer via GPO, but not so much in Mozilla with wetdog.exe and it's admin templates. I am using Windows Server 2003 enterprise edition R2 on 2 domain controllers, and Windows XP Professional SP3 client workstations with Mozilla 3.6.3 and the latest version of Wetdog.exe and it's admin templates.
    Any help would be much appreciated!!!
    == This happened ==
    Every time Firefox opened
    == My boss decided that we need to keep browsing history locked out of our existing 700+ workstations ==
    == Troubleshooting information ==
    just need to disable the "history" button, the "tools\clear recent history" button, and "tools\options\privacy tab\history"

    It can be annoying, but I think their motivation is good.  They are trying to make things better for their customers and I think they have, even though sometimes it is annoying.  I think it would be nice if they would advise us when the pages are going to be down for maintenance,  In the mean time, you could have another E mail account so you can always get access to your E mail.

Maybe you are looking for