Author: saqibkhan
-
Overview
Java DOM parser is an API (Application Programming Interface) that has classes, interfaces and methods to parse XML documents by creating DOM tree structure. The Document Object Model (DOM) is an official recommendation of the World Wide Web Consortium (W3C). It defines an interface that enables programs to access and update the style, structure, and…
-
Parsers
Java has various XML parsers that support object type and event type standards. We can read, create, query and modify the XML documents using these APIs. APIs provide interfaces that represent the XML documents, methods to retrieve and modify the elements and attributes in XML documents. XML Parsers XML Parsers are the software libraries or…
-
Overview
Java XML is simply working with an XML document from a Java program. Imagine, we have a file “products.xml” where we have product details such as name, brand and price. Now, we want to update prices for some products using Java programming. Before writing such java programs to access XML documents, we should know basics…
-
MathContext
Introduction The java.math.MathContext class provides immutable objects which encapsulate the context settings and describes certain rules for numerical operators, such as those implemented by the BigDecimal class. The base-independent settings are − Class declaration Following is the declaration for java.math.MathContext class − Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your…
-
BigInteger
Introduction The java.math.BigInteger class provides operations analogues to all of Java’s primitive integer operators and for all relevant methods from java.lang.Math. It also provides operations for modular arithmetic, GCD calculation, primality testing, prime generation, bit manipulation, and a few other miscellaneous operations. All operations behave as if BigIntegers were represented in two’s-complement notation. Semantics of arithmetic operations…
-
BigDecimal
Introduction The java.math.BigDecimal class provides operations for arithmetic, scale manipulation, rounding, comparison, hashing, and format conversion. The toString() method provides a canonical representation of a BigDecimal. It gives the user complete control over rounding behavior. Two types of operations are provided for manipulating the scale of a BigDecimal − This class and its iterator implement all of…
-
Clock
Introduction The java.time.Clock class provides access to the current instant, date and time using a time-zone. Class declaration Following is the declaration for java.io.Clock class − Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your career. Class constructors Sr.No. Constructor & Description 1 protected Clock()This creates a Clock. Class methods Sr.No.…
-
Examples of Logical Operators
Following are various examples of Logical Operators using regular expression in java. Sr.No Construct & Matches 1 XYX followed by Y. 2 X|YEither X or Y.
-
Examples of Possessive Quantifiers
A possessive quantifier is similar to greedy quantifier. It indicates the engine to start by checking the entire string.It is different in the sense if it doesn’t work, if match failed and there is no looking back. Following are various examples of Possessive Quantifiers using regular expression in java. Sr.No Construct & Matches 1 X?+X,…
-
Examples of Reluctant Quantifiers
A reluctant quantifier indicates the search engine to start with the shortest possible piece of the string. Once match found, the engine continue; otherwise it adds one character to the section of the string being checked and search that, and so on. This process follows until it finds a match or the entire string has…