What Does the Method addLast(E e) Do in Java?

Sravani S
Updated on 30-Jul-2019 22:30:21

194 Views

The addLast(E e) method of the java.util.LinkedList class inserts the specified element at the end of this list.Example:import java.util.*; public class LinkedListDemo {    public static void main(String[] args) {       LinkedList list = new LinkedList();       list.add("Hello");       list.add(2);       list.add("Chocolate");       list.add("10");       System.out.println("LinkedList:" + list);       list.addLast("Element");       System.out.println("LinkedList:" + list);    } }Output:LinkedList:[Hello, 2, Chocolate, 10] LinkedList:[Hello, 2, Chocolate, 10, Element]

Returning an Array in Java

George John
Updated on 30-Jul-2019 22:30:21

231 Views

Yes, an array can be returned from a java function. See the example below − Example public class Tester { public static void main(String[] args) { int[] array = getData(); for(int i: array) { System.out.println(i); } } public static int[] getData() { int[] dataArray = {1, 2, 3, 4}; return dataArray; } } Output 1 2 3 4

What Does the Method getFirst Do in Java

Ankitha Reddy
Updated on 30-Jul-2019 22:30:21

171 Views

The getFirst() method of the class java.util.LinkedList returns the first element of the current list. Example Live Demo import java.util.*; public class LinkedListDemo { public static void main(String[] args) { LinkedList list = new LinkedList(); list.add("Hello"); list.add(2); list.add("Chocolate"); list.add("10"); System.out.println("LinkedList:" + list); System.out.println("First Element :" + list.getFirst()); } } Output LinkedList:[Hello, 2, Chocolate, 10] First Element :Hello

Remove Null Value from a String Array in Java

Jai Janardhan
Updated on 30-Jul-2019 22:30:21

4K+ Views

Following program creates an array with null values. Convert it a list with not-null values only and then get the array of that list.Exampleimport java.util.ArrayList; import java.util.List; public class Tester { public static void main(String[] args) { String[] array = {"I", null, "love", null, "Java" }; List values = new ArrayList(); for(String data: array) { if(data != null) { values.add(data); } } String[] target = values.toArray(new String[values.size()]); for(String data: target) { System.out.println(data + " "); } } }OutputI love Java

Effect of NULL and Other Values on MySQL FIELD Function Output

Sai Subramanyam
Updated on 30-Jul-2019 22:30:21

91 Views

There will be a significant change in the output if we have the combination of NULL and other values in the list of strings, provided as arguments in FIELD() function. Following example will demonstrate it Example mysql> Select FIELD('good', 'Ram', 'is', 'good', 'boy'); +---------------------------------------+ | FIELD('good', 'Ram', 'is', 'good', 'boy') | +---------------------------------------+ | 3 | +---------------------------------------+ 1 row in set (0.00 sec) ... Read More

Using Different Engine Types in SAP HANA

Anil SAP Gupta
Updated on 30-Jul-2019 22:30:21

249 Views

It will use both OLAP and Join engine. The join between the FACT and DIM will be executed in the OLAP engine and joins inside the attribute views will be executed in the JOIN engine so both the engines will be used.

What Does the Method getLast Do in Java

Ramu Prasad
Updated on 30-Jul-2019 22:30:21

131 Views

The getLast() method of the class java.util.LinkedList returns the last element in this list.Example:import java.util.*; public class LinkedListDemo {    public static void main(String[] args) {       LinkedList list = new LinkedList();       list.add("Hello");       list.add(2);       list.add("Chocolate");       list.add("10");       System.out.println("LinkedList:" + list);       System.out.println("Last Element :" + list.getLast());    } }Output:LinkedList:[Hello, 2, Chocolate, 10] Last Element :10

Handling Failed Transactions in SAP HANA System

Anil SAP Gupta
Updated on 30-Jul-2019 22:30:21

269 Views

In SAP HANA system, Session and Transaction Manager is responsible to keep track of all the executed transactions in HANA database. It includes both running transactions and closed transaction. When a transaction in HANA system is failed due to any reason, Transaction Manager informs corresponding engine to handle the error.Session Manager is responsible to manage open and closed sessions and to authorize all the transactions executed in HANA db.

What Does the Method removeFirst Do in Java

Govinda Sai
Updated on 30-Jul-2019 22:30:21

138 Views

The removeFirst() method of the java.util.LinkedList class removes and returns the first element from this list.Example:import java.util.*; public class LinkedListDemo {    public static void main(String[] args) {       LinkedList list = new LinkedList();       list.add("Hello");       list.add(2);       list.add("Chocolate");       list.add("10");       System.out.println("LinkedList:" + list);       System.out.println("First element:" + list.removeFirst());       System.out.println("LinkedList:" + list);    } }Output:LinkedList:[Hello, 2, Chocolate, 10] First element:Hello LinkedList:[2, Chocolate, 10]

Handling User Requests for HANA System Applications

Anil SAP Gupta
Updated on 30-Jul-2019 22:30:21

173 Views

It consists of various components as mentioned above for processing of SQL statements from application users hosted on the top of HANA system.User requests via user interface/web browsers are sent to Web server hosting application which is communicated to SQL/MDX Processor in form of SQL queries. These are further segregated to different data engines in Index server according to query types.Session and Transaction Manager authorize SQL transactions and keep track of all the transactions either completed or running in the system.

Advertisements