Arjun Thakur has Published 1109 Articles

The isEmpty() method of CopyOnWriteArrayList method in Java

Arjun Thakur

Arjun Thakur

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

77 Views

To check whether the list is empty or not, use the isEmpty() method. TRUE is returned if the list is empty, else FALSE is the return value.The syntax is as followsboolean isEmpty()To work with CopyOnWriteArrayList class, you need to import the following packageimport java.util.concurrent.CopyOnWriteArrayList;The following is an example to implement ... Read More

How to pass check boxes data using JSP?

Arjun Thakur

Arjun Thakur

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

3K+ Views

Checkboxes are used when more than one option is required to be selected.Following is an example HTML code, CheckBox.htm, for a form with two checkboxes.                     Maths           Physics           Chemistry   ... Read More

C Program to display hostname and IP address

Arjun Thakur

Arjun Thakur

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

3K+ Views

In this section we will see how to see the Host name and IP address of the local system in an easier way. We will write a C program to find the host name and IP.Some of the following functions are used. These functions have different task. Let us see ... Read More

How to count horizontal values on a MySQL database?

Arjun Thakur

Arjun Thakur

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

346 Views

You can use aggregate function COUNT() from MySQL to count horizontal values on a database. Let us first create a table −mysql> create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    FirstValue int,    SecondValue int,    ThirdValue int,    FourthValue int ); Query OK, 0 ... Read More

How to loop thrugh a stored procedure in MySQL?

Arjun Thakur

Arjun Thakur

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

171 Views

Let us see how to loop through a stored procedure in MySQLmysql> DELIMITER // mysql> CREATE PROCEDURE do_WhileDemo(LastValue INT)    -> BEGIN       -> SET @loop = 0;       -> REPEAT          -> SET @loop= @loop+ 1;          -> select ... Read More

How do you define multiple filters in JSP?

Arjun Thakur

Arjun Thakur

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

649 Views

Your web application may define several different filters with a specific purpose. Consider, you define two filters AuthenFilter and LogFilter. Rest of the process will remain as explained above except you need to create a different mapping as mentioned below −    LogFilter    LogFilter           ... Read More

Display all records except one in MySQL

Arjun Thakur

Arjun Thakur

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

443 Views

You can use IN() to display all records except one in MySQL. Let us first create a table −mysql> create table DemoTable (    Id int,    FirstName varchar(20) ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, ... Read More

Why isn't sizeof for a struct equal to the sum of sizeof of each member in C/C++?

Arjun Thakur

Arjun Thakur

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

721 Views

The size of a struct type element taken by sizeof() is not always equal to the size of each individual member. Sometimes the compilers add some padding to avoid alignment issues. So the size may change. The padding is added when a structure member is followed by a member with ... Read More

The add() method of CopyOnWriteArrayList in Java

Arjun Thakur

Arjun Thakur

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

121 Views

Two types of add() methods are available in the CopyOnWriteArrayList class: add(E e) methodTo add elements in CopyOnWriteArrayList class in Java, use the add() method. Here, the element is appended to the end of the list.The syntax is as followsboolean add(E e)Here, the parameter e is the element to be ... Read More

Type difference of character literals in C and C++

Arjun Thakur

Arjun Thakur

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

547 Views

In C++ the size of the character constants is char. In C the type of character constant is integer (int). So in C the sizeof(‘a’) is 4 for 32bit architecture, and CHAR_BIT is 8. But the sizeof(char) is one byte for both C and C++.Example Live Demo#include main() {    printf("%d", ... Read More

Advertisements