George John has Published 1234 Articles

Check existence of an element in Java ArrayList

George John

George John

Updated on 13-Sep-2023 13:15:56

30K+ Views

The java.util.ArrayList.contains() method can be used to check if an element exists in an ArrayList or not. This method has a single parameter i.e. the element whose presence in the ArrayList is tested. Also it returns true if the element is present in the ArrayList and false if the element ... Read More

Error-Detecting Codes - Checksums

George John

George John

Updated on 13-Sep-2023 13:08:01

29K+ Views

Errors and Error DetectionWhen bits are transmitted over the computer network, they are subject to get corrupted due to interference and network problems. The corrupted bits leads to spurious data being received by the receiver and are called errors.Error detection techniques are responsible for checking whether any error has occurred ... Read More

Difference between strncmp() and strcmp() in C/C++

George John

George John

Updated on 12-Sep-2023 03:17:26

1K+ Views

strncmp()The function strncmp() is used to compare left string to right string up to a number. It works same as strcmp(). It returns a value greater than zero when the matching character of left string has greater ASCII value than the character of the right string. Returns a value less ... Read More

How to find the first character of a string in C#?

George John

George John

Updated on 10-Sep-2023 08:18:07

34K+ Views

To get the first character, use the substring() method.Let’s say the following is our string −string str = "Welcome to the Planet!";Now to get the first character, set the value 1 in the substring() method.string res = str.Substring(0, 1);Let us see the complete code −Example Live Demousing System; public class Demo ... Read More

How to cast from VARCHAR to INT in MySQL?

George John

George John

Updated on 07-Sep-2023 01:05:54

33K+ Views

To cast VARCHAR to INT, we can use the cast() function from MySQL. Here is the syntax of cast() function. cast(anyValue as dataType) For our example, we will create a table with the help of CREATE command. mysql> create table VarchartointDemo -> ( -> ... Read More

How do I check if a column is empty or null in MySQL?

George John

George John

Updated on 02-Sep-2023 15:49:47

43K+ Views

To check if a column is empty or null , we can use the WHERE clause with IS NULL and for empty we can use the condition ' ' i.e., empty space. The steps required for this are as folllows: First a table is created with the help of CREATE ... Read More

C++ Program to Implement Queue using Array

George John

George John

Updated on 02-Sep-2023 13:07:21

63K+ Views

A queue is an abstract data structure that contains a collection of elements. Queue implements the FIFO mechanism i.e., the element that is inserted first is also deleted first. In other words, the least recently added element is removed first in a queue.A program that implements the queue using an ... Read More

C++ Program to Implement Singly Linked List

George John

George John

Updated on 02-Sep-2023 12:10:41

64K+ Views

Singly linked list is a type of data structure that is made up of nodes that are created using self referential structures. Each of these nodes contain two parts, namely the data and the reference to the next list node. Only the reference to the first list node is required ... Read More

How to create a table with date column?

George John

George John

Updated on 02-Sep-2023 02:12:57

77K+ Views

To create a table with only date column, you can use DATE type. Let us first create a table −mysql> create table DemoTable    (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentName varchar(20),    StudentAdmissionDate DATE    ); Query OK, 0 rows affected (0.47 sec)Insert records in ... Read More

How to compile and run the C++ program?

George John

George John

Updated on 31-Aug-2023 01:59:36

131K+ Views

Once you've got your compiler and source program ready, it is very easy to compile and run a C++ program. Assuming that you've installed GCC compiler, and you have a source.cpp file that you want to compile, follow the following instructions to compile and run it. Step 1 − Open ... Read More

Advertisements