Paul Richard has Published 66 Articles

Difference between TreeMap, HashMap, and LinkedHashMap in Java

Paul Richard

Paul Richard

Updated on 21-Jun-2020 12:35:10

13K+ Views

HashMap, TreeMap and LinkedHashMap all implements java.util.Map interface and following are their characteristics.HashMapHashMap has complexity of O(1) for insertion and lookup.HashMap allows one null key and multiple null values.HashMap does not maintain any order.TreeMapTreeMap has complexity of O(logN) for insertion and lookup.TreeMap does not allow null key but allow multiple ... Read More

While adding the numbers contained in quotes, how MySQL evaluates if we write non-numeric text between numbers of a string?

Paul Richard

Paul Richard

Updated on 20-Jun-2020 13:49:59

92 Views

Suppose if we are trying to add the numbers having non-numeric text between numbers of a string, then MySQL simply use the first number of that string to evaluate the addition along with a warning. Following example will exhibit this −Examplemysql> Select '1525 * 2' + '200'As Total; +-------+ | ... Read More

How can we stuff a string with another one using MySQL functions?

Paul Richard

Paul Richard

Updated on 20-Jun-2020 13:05:02

353 Views

MySQL have two functions namely LPAD() and RPAD() with the help of which we can stuff a string with another string.LPAD() function, as the name suggests, left stuff a string with another string. Following is the syntax for using it in MySQL −SyntaxLPAD(original_string, @length, pad_string)Here,  original_string is the string in ... Read More

How can I use RAND() function in an ORDER BY clause to shuffle MySQL set of rows?

Paul Richard

Paul Richard

Updated on 20-Jun-2020 13:02:41

442 Views

When we use MySQL ORDER BY clause with RAND() function then the result set would have the shuffled set of rows. In other words, the result set would be in a random order. To understand it considers a table ‘Employee’ having the following records −mysql> Select * from employee; +----+--------+--------+ ... Read More

How can we use MySQL SELECT statement to count number of rows in a table?

Paul Richard

Paul Richard

Updated on 20-Jun-2020 06:29:06

240 Views

We need to use COUNT(*) function with SELECT clause to count the total number of rows in a table.Examplemysql> Select COUNT(*) from Student; +----------+ | COUNT(*) | +----------+ | 4        | +----------+ 1 row in set (0.06 sec)The query above counts the total number of ... Read More

How can I define a column of a MySQL table PRIMARY KEY without using the PRIMARY KEY keyword?

Paul Richard

Paul Richard

Updated on 19-Jun-2020 11:52:12

272 Views

As we know that a PRIMARY KEY column must have unique values and cannot have null values hence if we will define a column with UNIQUE and NOT NULL constraint both then that column would become PRIMARY KEY column.ExampleIn this example, we have created a table ‘Student123’ by defining column ... Read More

How to get Natural logarithm of 2 in JavaScript?

Paul Richard

Paul Richard

Updated on 18-Jun-2020 08:26:00

428 Views

To get the Natural logarithm of 2, use the Math.LN2 property in JavaScript. It returns the natural logarithm of 2, which is approximately 0.693.ExampleYou can try to run the following code to get Natural logarithm of 2 −Live Demo           JavaScript Math LN2 Property     ... Read More

Basic Internet Usage

Paul Richard

Paul Richard

Updated on 17-Jun-2020 13:25:34

951 Views

The Internet has become a very important part of our daily lives and has its applications in wide areas.Some of the areas in which Internet is used are −CommunicationsEducation and researchInstant messagingOnline business and shoppingOnline financial servicesFile and data sharingDeveloping collaborative softwareDesign and development of applications and computing environmentsContent managementEntertainmentSocial ... Read More

The Application Layer in TCP/IP Model

Paul Richard

Paul Richard

Updated on 17-Jun-2020 12:47:23

15K+ Views

The application layer is the highest abstraction layer of the TCP/IP model that provides the interfaces and protocols needed by the users. It combines the functionalities of the session layer, the presentation layer and the application layer of the OSI model.The functions of the application layer are −It facilitates the user ... Read More

The Presentation Layer of OSI Model

Paul Richard

Paul Richard

Updated on 17-Jun-2020 12:41:31

4K+ Views

The presentation layer (Layer 6) ensures that the message is presented to the upper layer in a standardized format. It deals with the syntax and the semantics of the messages.The main functions of the presentation layer are as follows −It encodes the messages from the user dependent format to the ... Read More

Advertisements