Fendadis John has Published 81 Articles

Which function in MySQL is used to reverse a particular string?

Fendadis John

Fendadis John

Updated on 22-Jun-2020 06:53:08

52 Views

MySQL REVERSE() function can be used to reverse a string. Following example will demonstrate it −mysql> Select REVERSE('Tutorialspoint'); +---------------------------+ | REVERSE('Tutorialspoint') | +---------------------------+ | tniopslairotuT            | +---------------------------+ 1 row in set (0.00 sec) mysql> Select Reverse('10-11-12'); +---------------------+ | Reverse('10-11-12') | +---------------------+ | 21-11-01   ... Read More

How MySQL NULL-safe equal operator performs when used with row comparisons?

Fendadis John

Fendadis John

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

66 Views

When we use NULL-safe operator with row comparisons like (A, B) (C, D) then its performance is equivalent to (A C) AND (B D). Following example will demonstrate it −mysql> Select (100, 50) (50, 100); +-----------------------+ | (100, 50) (50, 100) | +-----------------------+ |   ... Read More

How MySQL SUM() function evaluates if it is used with SELECT statement that returns no matching rows?

Fendadis John

Fendadis John

Updated on 22-Jun-2020 05:09:31

103 Views

When MySQL SUM() function used with SELECT statement that returns no matching rows then there is nothing to evaluate and it returns NULL as output. Sometimes, we thought it must return 0 as output but 0 is a number itself and for no matching rows it not significant to return ... Read More

Formatted Output in Java

Fendadis John

Fendadis John

Updated on 21-Jun-2020 15:10:18

2K+ Views

String provides format() method can be used to print formatted output in java.System.out.printf() method can be used to print formatted output in java.Following example returns a formatted string value by using a specific locale, format and arguments in format() methodExampleimport java.util.*; public class StringFormat {    public static void ... Read More

Garbage collection in Java

Fendadis John

Fendadis John

Updated on 21-Jun-2020 15:04:53

641 Views

Java Garbage collector tracks the live object and objects which are no more need are marked for garbage collection. It relieves developers to think of memory allocation/deallocation issues.JVM uses the heap, for dynamic allocation. In most of the cases, the operating systems allocate the heap in advance which is then ... Read More

Generating OTP in Java

Fendadis John

Fendadis John

Updated on 21-Jun-2020 15:00:56

4K+ Views

Generate OTP is now a requirement on most of the website now-a-days. In case of additional authentication, system generates a OTP password adhering to OTP policy of the company. Following example generates a unique OTP adhering to following conditions −It should contain at least one number.Length should be 4 characters.Exampleimport ... Read More

Flexible nature of java.lang.object

Fendadis John

Fendadis John

Updated on 21-Jun-2020 14:35:44

85 Views

The java.lang.Object class is the root of the class hierarchy. Every class has Object as a superclass. All objects, including arrays, implement the methods of this class.Class DeclarationFollowing is the declaration for java.lang.Object class −public class ObjectClass constructorsSr.No.Constructor & Description1Object()This is the Single Constructor.Class methodsSr.No.Method & Description1protected Object clone()This method ... Read More

Floating point operators and associativity in Java

Fendadis John

Fendadis John

Updated on 21-Jun-2020 14:24:45

361 Views

Following programs shows the float arithmetic can cause dubious result if integer values are used using float variables.Examplepublic class Tester {    public static void main(String[] args) {       float a = 500000000;       float b = -500000000;       float c = 1; ... Read More

Different ways for Integer to String conversion in Java

Fendadis John

Fendadis John

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

125 Views

Following are the different ways to convert an Integer to String in Java.Using Integer.toString(int) − Convert an int to String using static toString() method of Integer class.String b = Integer.toString(125);Using String.valueOf(int) − Convert an int to String using static valueOf() method of String class.String b = String.valueOf(125);Using new Integer(int).toString() − ... Read More

Deque interface in Java

Fendadis John

Fendadis John

Updated on 21-Jun-2020 12:26:34

298 Views

java.util.Deque interface is a subtype of java.util.Queue interface which supports insertion and removal of elements at both ends.Interface Declarationpublic interface Deque extends QueueArrayDeque ClassThe java.util.ArrayDeque class provides resizable-array and implements the Deque interface. Following are the important points about Array Deques −Array deques have no capacity restrictions so they grow ... Read More

Advertisements