AmitDiwan has Published 10740 Articles

Java Signature initSign() method with Examples

AmitDiwan

AmitDiwan

Updated on 23-Sep-2019 12:40:30

487 Views

The initSign() method initialize this object for signing. If this method is called again with a different argument, it negates the effect of this call.Let us now see an example −Exampleimport java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.PrivateKey; import java.security.Signature; import java.util.Scanner; public class Main {    public static void main(String args[]) ... Read More

Java Signature getProvider() method with Examples

AmitDiwan

AmitDiwan

Updated on 23-Sep-2019 12:38:17

208 Views

The provider for the signature object can be obtained using the method getProvider() in the class java.security.Signature.Let us now see an example −Exampleimport java.security.*; import java.util.*; public class Main {    public static void main(String[] argv) {       try {          Signature signature = Signature.getInstance("SHA256withRSA"); ... Read More

The abstract keyword in Java

AmitDiwan

AmitDiwan

Updated on 23-Sep-2019 12:35:35

474 Views

A class which contains the abstract keyword in its declaration is known as abstract class. Abstract classes may or may not contain abstract methods, i.e., methods without body. But, if a class has at least one abstract method, then the class must be declared abstract.If a class is declared abstract, it cannot be instantiated. To ... Read More

Traverse through a HashSet in Java

AmitDiwan

AmitDiwan

Updated on 23-Sep-2019 12:33:48

806 Views

HashSet extends AbstractSet and implements the Set interface. It creates a collection that uses a hash table for storage.A hash table stores information by using a mechanism called hashing. In hashing, the informational content of a key is used to determine a unique value, called its hash code.To traverse through a ... Read More

Java Signature getInstance() method with Examples

AmitDiwan

AmitDiwan

Updated on 23-Sep-2019 12:31:24

733 Views

A signature object that can implement the required signature algorithm can be obtained using the method getInstance() in the class java.security.Signature.Let us now see an example −Exampleimport java.security.*; import java.util.*; public class Main {    public static void main(String[] argv) {       try {         ... Read More

Java Signature getAlgorithm() method with Examples

AmitDiwan

AmitDiwan

Updated on 23-Sep-2019 12:29:24

237 Views

The name of the algorithm for the signature object can be obtained using the method getAlgorithm() in the class java.security.Signature.Let us now see an example −Exampleimport java.security.*; import java.util.*; public class Main {    public static void main(String[] argv) {       try {          Signature ... Read More

Log functions in Java

AmitDiwan

AmitDiwan

Updated on 23-Sep-2019 12:27:32

370 Views

The log functions in Java are part of java.lang.Math. The functions include log, log10, log1p. Let us see an example of each of these log functions −static double log(double a)The java.lang.Math.log(double a) returns the natural logarithm (base e) of a double value. Let us see an example −Exampleimport java.io.*; public ... Read More

Trigonometric Functions in Java

AmitDiwan

AmitDiwan

Updated on 23-Sep-2019 12:23:14

2K+ Views

The java.lang.Math class contains methods for trigonometric operations like cos(), sin(), tan(), tanh(), cosh(), atan(), etc.Let us work around some of these trigonometric functions in Java −static double asin(double a)The java.lang.Math.asin(double a) returns the arc sine of an angle, in the range of -pi/2 through pi/2.Let us now see an ... Read More

StringTokenizer methods in Java

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 11:32:32

403 Views

The StringTokenizer class allows an application to break a string into tokens. Following are the methods −Sr.NoMethod & Description1int countTokens()This method calculates the number of times that this tokenizer's nextToken method can be called before it generates an exception.2boolean hasMoreElements()This method returns the same value as the hasMoreTokens method.3boolean hasMoreTokens()This method tests ... Read More

HTML DOM Textarea autofocus Property

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 11:29:46

196 Views

The HTML DOM Textarea autofocus property returns and modify whether the text area should automatically get focused or not when the page loads.SyntaxFollowing is the syntax −1. Returning autofocusobject.autofocus2. Modifying autofocusobject.autofocus = true | falseLet us see an example of HTML DOM Textarea autofocus Property:Example    body { ... Read More

Advertisements