Rishi Raj has Published 131 Articles

Dynamic method dispatch or Runtime polymorphism in Java

Rishi Raj

Rishi Raj

Updated on 21-Jun-2020 13:12:05

9K+ Views

Runtime Polymorphism in Java is achieved by Method overriding in which a child class overrides a method in its parent. An overridden method is essentially hidden in the parent class, and is not invoked unless the child class uses the super keyword within the overriding method. This method call resolution ... Read More

Difference between HashTable and HashMap in Java

Rishi Raj

Rishi Raj

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

3K+ Views

Following are the notable differences between HashTable and HashMap classes in Java. HashTableHashMapSynchronizedHashTable is synchronized.HashMap is not synchronized.Thread SafeHashTable is thread safe.HashMap is not thread safe.Null objectsHashTable does not allows null keys or null values.HashMap allows one null key and multiple null values.PerformanceHashTable is faster.HashMap is slower than HashTable.Since Java Version1.21.5Exampleimport ... Read More

How can column data be used within MySQL CASE statement?

Rishi Raj

Rishi Raj

Updated on 20-Jun-2020 13:43:50

100 Views

To understand it consider the data, as follows, from the table ‘Students’ −mysql> Select * from Students; +----+-----------+-----------+----------+----------------+ | id | Name      | Country   | Language | Course         | +----+-----------+-----------+----------+----------------+ | 1  | Francis   | UK        | English  | ... Read More

What MySQL returns if we convert an empty hexadecimal value to a number?

Rishi Raj

Rishi Raj

Updated on 20-Jun-2020 12:01:04

50 Views

As we know that an empty hexadecimal value is a zero-length binary string hence if 0 is added to it then the result would be 0. In other words, we can say that if we convert an empty hexadecimal value to a number then it produces 0. The following query ... Read More

What MySQL returns if we pass column name, containing a NULL value, as one of the arguments of CONCAT() function?

Rishi Raj

Rishi Raj

Updated on 20-Jun-2020 08:22:31

62 Views

As we know that CONCAT() function will return NULL if any of the argument of it is NULL. It means MySQL will return NULL if we pass column name, containing a NULL value, as one of the arguments of CONCAT() function. Following is an example of ‘Student’ table to explain ... Read More

How can we sort MySQL output in descending order?

Rishi Raj

Rishi Raj

Updated on 20-Jun-2020 06:25:46

115 Views

We need to specify DESC (short form for DESCENDING) keyword in ORDER BY clause if we want to sort out the result set in descending order.SyntaxSelect column1, column2, …, columN From table_name ORDER BY column1[column2, …] DESC;ExampleIn the following example, we have sorted the result set by column ‘Id’ in ... Read More

How can we automatically define the structure of MySQL table same as the structure of another table?

Rishi Raj

Rishi Raj

Updated on 20-Jun-2020 06:07:11

64 Views

CREATE TABLE command with LIKE keyword will be able to define the structure of a MySQL table same as the structure of another table.SyntaxCREATE TABLE new_table LIKE old_table;Examplemysql> Create table employee(ID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NAME VARCHAR(20)); Query OK, 0 rows affected (0.21 sec) mysql> Describe employee; ... Read More

How can we remove PRIMARY KEY constraint from a column of an existing MySQL table?

Rishi Raj

Rishi Raj

Updated on 19-Jun-2020 11:53:03

4K+ Views

We can remove PRIMARY KEY constraint from a column of an existing table by using DROP keyword along with ALTER TABLE statement.ExampleSuppose we have a table ‘Player’ having a PRIMARY KEY constraint on column ‘ID’ as follows −mysql> DESCRIBE Player; +-------+-------------+------+-----+---------+-------+ | Field | Type        | ... Read More

Which statement, other than ALTER TABLE statement, can be used to apply UNIQUE constraint to the field of an existing MySQL table?

Rishi Raj

Rishi Raj

Updated on 19-Jun-2020 11:48:53

76 Views

CREATE UNIQUE INDEX statement can also be used to apply the UNIQUE constraint to the field of an existing MySQL table. The syntax of it is as follows −CREATE UNIQUE INDEX index_name ON table_name(Column_name);ExampleSuppose we have the following table named ‘Test5’ and we want to add UNIQUE constraint to the ... Read More

Architecture of the Internet

Rishi Raj

Rishi Raj

Updated on 17-Jun-2020 13:24:14

17K+ Views

The architecture of the Internet is ever-changing due to continuous changes in the technologies as well as the nature of the service provided. The heterogeneity and vastness of the Internet make it difficult to describe every aspect of its architecture.The overall architecture can be described in three levels −Backbone ISP ... Read More

Advertisements