AmitDiwan has Published 9818 Articles

Java Signature toString() method with Examples

AmitDiwan

AmitDiwan

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

220 Views

The string representation for the signature object can be obtained using the method getString() in the class java.security.Signature. This includes information such as the object state, algorithm name etcLet us now see an example −Exampleimport java.security.*; import java.util.*; public class Main {    public static void main(String[] argv) {   ... Read More

Java Signature initSign() method with Examples

AmitDiwan

AmitDiwan

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

515 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

220 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

512 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

Java Signature getInstance() method with Examples

AmitDiwan

AmitDiwan

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

751 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

246 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

399 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

StringTokenizer methods in Java

AmitDiwan

AmitDiwan

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

433 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

211 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

The new operator in Java

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 11:23:09

7K+ Views

The new operator is used in Java to create new objects. It can also be used to create an array object.Let us first see the steps when creating an object from a class −Declaration − A variable declaration with a variable name with an object type.Instantiation − The 'new' keyword ... Read More

Advertisements