To apply modulus (%) operator to floating-point values in an effortless task. Let us see how.We have the following two values −double one = 9.7; double two = 1.2;Let us now apply the modulus operator −one % twoThe following is the complete example that displays the output as well −Example Live Demopublic class Demo { public static void main(String args[]) { double one = 9.7; double two = 1.2; System.out.println( one % two ); } }Output0.09999999999999964
Religion today has taken a much-institutionalized form. Its origin has always been debated and discussed today by various scholars. In sociological terms, ‘Religion is a system of sacred belief and practices both in the tangible and intangible form’. Religion can serve the dual role of ideology as well as institution. Today, religion has assumed a more narrow-minded approach. However, understanding religion in the broad sense highlights the following important points about it in society:Cultural IdentityReligion plays a crucial role for a person in giving a cultural identity. Each religion has festivals, traditions, mythologies which form a part of the tangible ... Read More
You can use WHERE clause and OR operator to show table with multiple LIKE. The syntax is as follows:show table from yourDatabaseName where tables_in_yourDatabaseName Like ‘%anyTableName%’ or tables_in_yourDatabaseName Like ‘%anyTableName2%’ or tables_in_yourDatabaseName Like ‘%anyTableName3%’ . . . . or tables_in_yourDatabaseName Like ‘%anyTableNameN%’In the above syntax, only the table name in the database is displayed.Here the database ‘test’ and the tables in the same database is considered. The query to show tables with multiple LIKE is as follows -mysql> show tables from test -> where tables_in_test like '%userrole%' -> or tables_in_test like '%view_student%' -> or tables_in_test like '%wholewordmatchdemo%';The following is the ... Read More
When the full name is provided, the initials of the name are printed with the last name is printed in full. An example of this is given as follows −Full name = Amy Thomas Initials with surname is = A. ThomasA program that demonstrates this is given as follows −Example Live Demoimport java.util.*; public class Example { public static void main(String[] args) { String name = "John Matthew Adams"; System.out.println("The full name is: " + name); System.out.print("Initials with surname is: "); int len = name.length(); ... Read More
Select non-empty column values using NOT IS NULL and TRIM() function. The syntax is as follows.SELECT * FROM yourTableName WHERE yourColumnName IS NOT NULL AND TRIM(yourColumnName) ' ';You can select non-empty value as well as whitespace from column using the same TRIM() function.To understand the syntax we discussed above, let us create a table. The query to create a table is as follows −mysql> create table SelectNonEmptyValues -> ( -> Id int not null auto_increment, -> Name varchar(30), -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (0.62 sec)Insert records in the table ... Read More
Literary Devices are the peculiar structures used by writers in their works in order to convey their messages in a simple manner to the readers.The various literary devices used in English Literature areAlliteration, Analogy, Allegory, Anaphora, Metaphor, Simile, Aphorism, Oxymoron, Onomatopoeia, Eulogy, Elegy, and others.Alliteration: It is the device in which a number of words, having the same first consonant sound, occur close together in a series.Example- He had a haunting hat.Analogy: It is the comparison of an idea or a thing with another. Metaphors and similes are used to draw analogies. A metaphor is an implied comparison while a ... Read More
Water is a very important resource not only for us but also for our future generations. We should; therefore, save it in order to provide the maximum benefit to others. Water is necessary for our lives. So, if we save water, we save life.However, one must either not be aware of the ways to conserve it or may be reluctant thinking that such work will require a lot of toil. Let's talk about the ways in which water can be conserved.Turn off the Tap Post Use: While we brush our teeth, water keeps spilling out. It is necessary to close ... Read More
To auto generate database diagram in MySQL, use MySQL workbench. For this, select the option from database as shown below −Database->Reverse EngineerHere is the snapshot showing the Database tab −After clicking “Database” above, choose the option “Reverse Engineer”. This state the “Reverse Engineer” mode.Clicking above will display the following table automatically. We had one table in the database “business”. The same table “tblstudent” is visible here −
The h format in Java Date is like 1-12 hour in AM/ PM. Use SimpleDateFormat("h") to get the same format;// displaying hour in h format SimpleDateFormat simpleformat = new SimpleDateFormat("h"); String strHour = simpleformat.format(new Date()); System.out.println("Hour in h format = "+strHour);Above, we have used the SimpleDateFormat class, therefore the following package is imported −import java.text.SimpleDateFormat;The following is an example −Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo { public static void main(String[] args) throws Exception { // displaying current date and time ... Read More
To make MySQL’s NOW() and CURDATE() functions use UTC, you need to write my.cnf file. Write the below instruction in my.cnf −[mysqld_safe] timezone = UTCFirstly, reach the directory with the help of the following query −mysql> select @@datadir;The following is the output −+---------------------------------------------+ | @@datadir | +---------------------------------------------+ | C:\ProgramData\MySQL\MySQL Server 8.0\Data\ | +---------------------------------------------+ 1 row in set (0.00 sec)Now reach the directory for which the link ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP