Samual Sam has Published 2310 Articles

LocalTime until() Method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

5K+ Views

The difference between two LocalTime objects can be obtained using the until() method in the LocalTime class in Java. This method requires two parameters i.e. the end time for the LocalTime object and the Temporal unit. Also, it returns the difference between two LocalTime objects in the Temporal unit specified.A ... Read More

IntBuffer equals() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

208 Views

The equality of two buffers can be checked using the method equals() in the class java.nio.IntBuffer. Two buffers are equal if they have the same type of elements, the same number of elements and same sequence of elements. The method equals() returns true if the buffers are equal and false ... Read More

I want to create a custom tag in JSP. How to write a custom tag in JSP?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

241 Views

A custom tag is a user-defined JSP language element. When a JSP page containing a custom tag is translated into a servlet, the tag is converted to operations on an object called a tag handler. The Web container then invokes those operations when the JSP page's servlet is executed.JSP tag ... Read More

How to determine if an input string ends with a specified suffix in JSP?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

325 Views

The fn:endsWith() function determines if an input string ends with a specified suffix.SyntaxThe fn:endsWith() function has the following syntax −boolean endsWith(java.lang.String, java.lang.String)ExampleFollowing example explains the functionality of the fn:substring function −           Using JSTL Functions                 ... Read More

Duration plus() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

201 Views

An immutable copy of a duration where the required duration is added to it can be obtained using the plus() method in the Duration class in Java. This method requires two parameters i.e. the duration to be added and the TemporalUnit of the duration. Also, it returns the duration with ... Read More

How to work with one database connection object in the entire Java-MySQL application?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

808 Views

Use the singleton design pattern. Here is the Java code that returns a single object −ConnectDatabase.javaimport java.sql.Connection; import java.sql.DriverManager; public class ConnectDatabase {    static Connection conn = null;    public static Connection getConnection() {       if (conn != null) return conn;       String database = ... Read More

FloatBuffer allocate() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

126 Views

A new FloatBuffer can be allocated using the method allocate() in the class java.nio.FloatBuffer. This method requires a single parameter i.e. the capacity of the buffer. It returns the new FloatBuffer that is allocated. If the capacity provided is negative, then the IllegalArgumentException is thrown.A program that demonstrates this is ... Read More

KeyPairGenerator getAlgorithm() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

90 Views

The algorithm name for the key pair generator can be obtained using the method getAlgorithm() in the class java.security.KeyPairGenerator. This method requires no parameters and it returns the algorithm name for the key pair generator.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class ... Read More

Duration multipliedBy() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

99 Views

An immutable copy of a duration where the required duration is multiplied by a value can be obtained using the method multipliedBy() in the Duration class in Java. This method requires a single parameter i.e. the value which is to be multiplied and it returns the immutable copy of the ... Read More

What are the standard attributes that should be passed to a custom tag in a JSP page?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

79 Views

Consider including the following properties for an attribute −S.No.Property & Purpose1nameThe name element defines the name of an attribute. Each attribute name must be unique for a particular tag.2requiredThis specifies if this attribute is required or is an optional one. It would be false for optional.3rtexprvalueDeclares if a runtime expression ... Read More

Advertisements