
- Java XML Home
- Java XML Overview
- Java XML Parsers
- Java DOM Parser
- Java DOM Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- Java SAX Parser
- Java SAX Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- JDOM XML Parser
- JDOM XML Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- Java StAX Parser
- Java StAX Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- Java XPath Parser
- Java XPath Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- Java DOM4J Parser
- Java DOM4J Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- Java XML Useful Resources
- Java XML - Questions and Answers
- Java XML - Quick Guide
- Java XML - Useful Resources
- Java XML - Discussion
Java JDOM Document hashCode() Method
The Java JDOM hashCode() method of Document class is used to get the hash code of an XML document. Hash code is a unique integer value that is used to a identify XML documents individually. This hash code is used to check data integrity and other security concerns of XML documents.
Syntax
Following is the syntax of the Java JDOM Document hashCode() method −
Document.hashCode();
Parameters
The Java hashCode() method doesn't accept any parameters.
Return Value
The Java hashCode() method returns the hash code as integer value.
Example
Here is the basic example of using the Java JDOM Document hashCode() method −
import org.jdom2.Document; public class GetHashCode { public static void main(String args[]) { try { //Creating new document Document doc = new Document(); int hashCode = doc.hashCode(); System.out.println("Hash code of this document: "+hashCode); } catch(Exception e) { e.printStackTrace(); } } }
The Hash code of the XML document is displayed.
Hash code of this document: 1599771323
Advertisements