GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Python Technologies
  • Databases
  • Computer Programming
  • Web Development
  • Java Technologies
  • Computer Science
  • Mobile Development
  • Big Data & Analytics
  • Microsoft Technologies
  • DevOps
  • Latest Technologies
  • Machine Learning
  • Digital Marketing
  • Software Quality

This view

  • Original page
  • New address

GeezerVison is showing www.tutorialspoint.com — Java.math.BigInteger.hashCode() Method

Java.math package tutorial
  • Java.math - Home
  • Java.math - BigDecimal
  • Java.math - BigInteger
  • Java.math - MathContext
  • Java.math - Enumerations
  • Java.math - Discussion
Selected Reading
  • UPSC IAS Exams Notes
  • Developer's Best Practices
  • Questions and Answers
  • Online Resume Builder
  • HR Interview Questions
  • Computer Glossary
  • Who is Who

Java.math.BigInteger.hashCode() Method



Previous
Quiz
Next

Description

The java.math.BigInteger.hashCode() returns the hash code for this BigInteger.

Declaration

Following is the declaration for java.math.BigInteger.hashCode() method.

public int hashCode()

Overrides

hashCode in class Object.

Parameters

NA

Return Value

This method returns the hash code for this BigInteger.

Exception

NA

Example

The following example shows the usage of math.BigInteger.hashCode() method.

package com.tutorialspoint;

import java.math.*;

public class BigIntegerDemo {

   public static void main(String[] args) {

      // create 2 BigInteger objects
      BigInteger bi1, bi2;
   
      // create 2 int objects
      int i1, i2;

      // assign values to bi1, bi2
      bi1 = new BigInteger("12345");
      bi2 = new BigInteger("923456789123");

      // assign the hashcode of bi1, bi2 to i1, i2
      i1 = bi1.hashCode();
      i2 = bi2.hashCode();

      String str1 = "HashCode of " +bi1+ " is " +i1;
      String str2 = "HashCode of " +bi2+ " is " +i2;

      // print i1, i2 values
      System.out.println( str1 );
      System.out.println( str2 );
   }
}

Let us compile and run the above program, this will produce the following result −

HashCode of 12345 is 12345
HashCode of 923456789123 is 38827148
java_math_biginteger.htm
Tutorix - AI Tutor
Previous Quiz Next
Advertisements
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.