Karthikeya Boyini has Published 2383 Articles

Format date in MySQL to return MonthName and Year?

karthikeya Boyini

karthikeya Boyini

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

71 Views

Use DATE_FORMAT() and set the specifiers to display only the MonthName and Year. Let us first create a table −mysql> create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    AdmissionDate date ); Query OK, 0 rows affected (0.69 sec)Insert records in the table using insert command ... Read More

Custom ArrayList in Java

karthikeya Boyini

karthikeya Boyini

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

714 Views

A custom ArrayList can have multiple types of data and its attributes in general are based on the user requirements.A program that demonstrates a custom ArrayList is given as follows −Example Live Demoimport java.util.ArrayList; public class CustomArrayList {    int n = 5;    class Employee {       int ... Read More

How to create Java Priority Queue to ignore duplicates?

karthikeya Boyini

karthikeya Boyini

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

944 Views

The simplest way to create a Java Priority Queue to ignore duplicates is to first create a Set implementation −HashSet set = new HashSet (); set.add(100); set.add(150); set.add(250); set.add(300); set.add(250); set.add(500); set.add(600); set.add(500); set.add(900);Now, create Priority Queue and include the set to remove duplicates in the above set ... Read More

Link Control Protocol (LCP)

karthikeya Boyini

karthikeya Boyini

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

4K+ 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

96 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

77 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

143 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 sum up elements of a C++ vector?

karthikeya Boyini

karthikeya Boyini

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

20K+ Views

Sum up of all elements of a C++ vector can be very easily done by std::accumulate method. It is defined in header. It accumulates all the values present specified in the vector to the specified sum.AlgorithmBegin    Declare v of vector type.       Initialize some values into ... 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

13K+ 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

102 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

Advertisements