Using Database View in SAP HANA

SAP ABAP Expert
Updated on 21-Feb-2020 07:31:51

914 Views

A view in a database is defined as Virtual table which derives its data from one or more columns of one table or multiple tables. A view can be created using tables of one or more database and is stored in database where it is created.You can find views in SAP HANA Studio under schema name −

Change Default Sort Order of MySQL Tables

Giri Raju
Updated on 21-Feb-2020 07:09:56

698 Views

As we know that when we use ORDER BY Clause, the default sort order of MySQL table is ascending, start with the smallest value. We can change this default order by using DESC keyword along with ORDER BY Clause. The following example will clarify this concept −>mysql> Select * from STUDENT ORDER BY Name DESC; +--------+--------+--------+ | Name   | RollNo | Grade  | +--------+--------+--------+ | Gaurav |    100 | B.tech | | Aryan  |    165 | M.tech | | Aarav  |    150 | M.SC   | +--------+--------+--------+ 3 rows in set (0.00 sec)We can see that after using the keyword DESC the default order has been changed from ascending to descending.

Create Unmodifiable List in Java 9

raja
Updated on 21-Feb-2020 06:02:16

502 Views

A list considered to be unmodifiable if the elements can't be added, removed, or replaced from a list once an unmodifiable instance of a list has created. The static factory method: List.of() provides a convenient way to create unmodifiable lists in Java 9.An instance of a list created by using the List.of() method has the following characteristics.The list returned by a factory method is conventionally immutable. It means that the elements can't be added, removed, or replaced from a list. Calling any mutator method on the List causes UnsupportedOperationException.If the contained elements of List are mutable, it may cause the List's contents to appear to ... Read More

How Does isinstance Function Work in Python

Rajendra Dharmkar
Updated on 21-Feb-2020 05:17:14

240 Views

We can derive a class from multiple parent classes as follows −class A:        # define your class A ..... class B:         # define your class B ..... class C(A, B):   # subclass of A and B .....We can use isinstance() function to check the relationships of two classes and instances.Theisinstance(obj, Class) boolean function returns true if obj is an instance of class Class or is an instance of a subclass of Class

issubclass Function in Python

Rajendra Dharmkar
Updated on 21-Feb-2020 05:13:17

114 Views

We can derive a class from multiple parent classes as follows −class A:        # define your class A ..... class B:         # define your class B ..... class C(A, B):   # subclass of A and B .....We can use issubclass() function to check the relationships of two classes and instances.For example, theissubclass(sub, sup) boolean function returns true if the given subclass sub is indeed a subclass of the superclass sup.

Importance of Iterate Method of Stream API in Java 9

raja
Updated on 21-Feb-2020 05:11:39

440 Views

In Java 8, the iterate() method of Stream API takes the seed and the unary operator as arguments. As stream becomes infinite, it makes the developer add explicit termination conditions by using limit, findFirst, findAny and etc. In Java 9, the iterate() method of Stream API has added a new argument, a predicate that takes the condition to break the flow.Syntaxstatic Stream iterate(T seed, Predicate

Advantages of Private Methods in an Interface in Java 9

raja
Updated on 21-Feb-2020 04:59:01

595 Views

In Java 9, an interface can also have private methods. Apart from static and default methods in Java 8, this is another significant change as it allows the re-usability of common code within the interface itself.In an interface, there is a possibility of writing common code on more than one default method that leads to code duplication. The introduction of private methods avoids this code duplication.Advantages of private methods in an interfaceAvoiding code duplication.Ensuring code re-usability.Improving code readability.Syntaxinterface interfacename {    private methodName(parameters) {       // statements     } }Exampleinterface Test {    default void m1() {       common();    }   ... Read More

Check if A is Superclass of B in Python

Rajendra Dharmkar
Updated on 20-Feb-2020 12:48:09

358 Views

We have the classes A and B defined as follows −class A(object): pass class B(A): passExampleA can be proved to be a super class of B in two ways as followsclass A(object):pass class B(A):pass print issubclass(B, A) # Here we use the issubclass() method to check if B is subclass of A print B.__bases__ # Here we check the base classes or super classes of BOutputThis gives the outputTrue (,)

Understand the equals Method in Java

Lakshmi Srinivas
Updated on 20-Feb-2020 12:46:45

218 Views

The equals(Object[] a, Object[] a2) method of the java.util.Arrays class returns true if the two specified arrays of objects are equal to one another. The two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. Two objects e1 and e2 are considered equal if (e1==null ? e2==null : e1.equals(e2)). The two arrays are equal if they contain the same elements in the same order. Two array references are considered equal if both are null.Exampleimport java.util.Arrays; public class ArrayDemo {    public static void main(String[] ... Read More

What Does the Method equals(int a1, int a2) Do in Java

Monica Mona
Updated on 20-Feb-2020 12:46:02

316 Views

The equals(int[] a, int[] a2) method of java.util.Arrays returns true if the two specified arrays of integers are equal to one another. Two arrays are equal if they contain the same elements in the same order. Two array references are considered equal if both are null.Exampleimport java.util.Arrays; public class ArrayDemo {    public static void main(String[] args) {       int[] arr1 = new int[] { 10, 12, 5, 6 };       int[] arr2 = new int[] { 10, 12, 5, 6 };       int[] arr3 = new int[] { 10, 5, 6, 12 };     ... Read More

Advertisements