Karthikeya Boyini has Published 2193 Articles

Link Control Protocol (LCP)

karthikeya Boyini

karthikeya Boyini

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

6K+ Views

Link Control Protocol (LCP) is a part of Point – to – Point Protocol (PPP) that operates in the data link layer. It is responsible for establishing, configuring, testing, maintaining and terminating links for transmission. It also imparts negotiation for set up of options and use of features by the ... Read More

ArrayBlockingQueue Class in Java

karthikeya Boyini

karthikeya Boyini

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

177 Views

A bounded blocking queue that is backed by an array is known as a ArrayBlockingQueue Class in Java. The size of the queue is fixed in the class and it uses FIFO for ordering elements. The ArrayBlockingQueue Class is a member of the Java Collections Framework.A program that demonstrates this ... Read More

CharBuffer slice() method in Java

karthikeya Boyini

karthikeya Boyini

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

145 Views

A new CharBuffer with the content as a shared subsequence of the original CharBuffer can be created using the method slice() in the class java.nio.CharBuffer. This method returns the new CharBuffer that is read-only if the original buffer is read-only and direct if the original buffer is direct.A program that ... Read More

Java Program to get the number of hours in this duration

karthikeya Boyini

karthikeya Boyini

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

202 Views

At first, set the Duration −Duration duration = Duration.ofDays(25);Now, get the number of hours from the above Duration that has 25 days −duration.toHours()Example Live Demoimport java.time.Duration; public class Demo {    public static void main(String[] args) {       Duration duration = Duration.ofDays(25);       System.out.println("Hours in 25 days ... Read More

How to write an if-else statement in a JSP page?

karthikeya Boyini

karthikeya Boyini

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

16K+ Views

The if...else block starts out as an ordinary Scriptlet, but the Scriptlet is closed at each line with HTML text included between the Scriptlet tags.Example Live Demo           IF...ELSE Example                         Today is weekend ... Read More

Java Program to get previous and next index using ListIterator

karthikeya Boyini

karthikeya Boyini

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

190 Views

To get the exact evaluation of the previous and next index, you need use the next() method of the Iterator. This will eventually help you in gaining more understanding about Iterators. Let us first create an ArrayList and add some elements −ArrayList arrList = new ArrayList (); arrList.add(100); ... Read More

LinkedBlockingQueue Class in Java

karthikeya Boyini

karthikeya Boyini

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

171 Views

The LinkedBlockingQueue Class in Java has a blocking queue that is optionally bounded and based on linked nodes. This means that if the capacity is provided then the LinkedBlockingQueue is bound, otherwise it is not bound. Also, FIFO for ordering elements.A program that demonstrates this is given as follows −Example Live ... Read More

How to maps key to the localized message and performs the parametric replacement in a JSP?

karthikeya Boyini

karthikeya Boyini

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

186 Views

The tag maps key to the localized message and performs the parametric replacement.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultkeyMessage key to retrieveNoBodybundleResource bundle to useNoDefault bundlevarName of the variable to store the localized messageNoPrint to pagescopeThe scope of the variable to store the localized messageNoPageExample ... Read More

How to remove all elements from a Collection in another Collection

karthikeya Boyini

karthikeya Boyini

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

582 Views

Let’s say the following is our Collection i.e. ArrayList −Listlist = new ArrayList(); list.add(100); list.add(200); list.add(200); list.add(200); list.add(300); list.add(400); list.add(400); list.add(500);Now, create another Collection −List list2 = new ArrayList(); list2.add(100); list2.add(200); list2.add(300); list2.add(400);To remove all elements from a Collection in another Collection, try the following with list and list2 as ... Read More

CharBuffer duplicate() method in Java

karthikeya Boyini

karthikeya Boyini

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

121 Views

A duplicate buffer of a buffer can be created using the method duplicate() in the class java.nio.CharBuffer. This duplicate buffer is identical to the original buffer. The method duplicate() returns the duplicate buffer that was created.A program that demonstrates this is given as follows −Example Live Demoimport java.nio.*; import java.util.*; public ... Read More

Advertisements