Articles on Trending Technologies

Technical articles with clear explanations and examples

What is the difference between the size of ArrayList and length of Array in Java?

Srinivas Gorla
Srinivas Gorla
Updated on 30-Jul-2019 2K+ Views

ArrayList doesn't have length() method, the size() method of ArrayList provides the number of objects available in the collection.Array has length property which provides the length or capacity of the Array. It is the total space allocated during the initialization of the array.

Read More

How can I fetch the value of REPLACE() function in the column name of our choice?

Ankitha Reddy
Ankitha Reddy
Updated on 30-Jul-2019 161 Views

For fetching the values of REPLACE() function in our choice column name, we need to use the keyword ‘AS’ with REPLACE() function. Example mysql> Select Name, REPLACE(Name, 'G','S') AS Name_Changed from student Where Subject = 'Computers'; +--------+--------------+ | Name | Name_Changed | +--------+--------------+ | Gaurav | Saurav | | Gaurav | Saurav | +--------+--------------+ 2 rows in set (0.00 sec) The query above will give the result set of REPLACE() function in column name of our choice ‘Name_Changed’ which is given after keyword ‘AS’.

Read More

how to convert Object array to String array in java

Sai Nath
Sai Nath
Updated on 30-Jul-2019 5K+ Views

As list.toArray() returns an Object[], it can be converted to String array by passing the String[] as parameter. See the example below.import java.util.ArrayList; import java.util.List; public class Tester { public static void main(String[] args) { List data = new ArrayList(); data.add("A"); data.add("B"); data.add("C"); //Object[] objects = data.toArray(); String[] strObjects = data.toArray(new String[0]); for(String obj: strObjects) { System.out.println(obj); } } }OutputA B C

Read More

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

George John
George John
Updated on 30-Jul-2019 11K+ Views

We can remove FOREIGN KEY constraint from a column of an existing table by using DROP keyword along with ALTER TABLE statement. Syntax ALTER TABLE table_name DROP FOREIGN KEY constraint_name Here constraint name is the name of foreign key constraint which we applied while creating the table. If no constraint name is specified then MySQL will provide constraint name which can be checked by SHOW CREATE TABLE statement. Example The following query will delete the FOREIGN KEY constraint from ‘orders’ table − mysql> Alter table orders DROP FOREIGN KEY orders_ibfk_1; Query OK, 0 rows affected (0.22 sec) ...

Read More

What is Java Method Area?

Ayyan
Ayyan
Updated on 30-Jul-2019 2K+ Views

JVM has a method area common across all the threads. It contains per-class elements like constant pool, fields, method local data, method code, constructor codes etc. which are used in class and initialization of objects/interfaces.This method area gets created during JVM start-up. It is generally part of Heap area. It could be of fixed size or vary. Its memory may not be contiguous. JVM implementation can give control to programmer over Method area creation, its sizing etc. If method area memory is not sufficient to satisfy an allocation request then JVM throws OutOfMemoryError.

Read More

Can a Vector contain heterogeneous objects in Java?

Ramu Prasad
Ramu Prasad
Updated on 30-Jul-2019 1K+ Views

Since a vector stores elements in the form of objects, you can store objects of various types (heterogeneous) in it.Example:import java.util.*; class Demo{} public class VectorSample {    public static void main(String args[]) {       Demo obj = new Demo();       Vector v = new Vector(3, 2);       System.out.println("Initial size: " + v.size());       System.out.println("Initial capacity: " + v.capacity());       v.addElement(new Integer(1));       v.addElement(new String("krishna"));       v.addElement(new Float(3.5f));       v.addElement(obj);       System.out.println("Capacity after four additions: " + v.capacity());    } }

Read More

Checking for Null or Empty or White Space Only String in Java.

Anjana
Anjana
Updated on 30-Jul-2019 2K+ Views

We can verify whether the given string is empty using the isEmpty() method of the String class. This method returns true only if length() is 0. Example import java.lang.*; public class StringDemo {     public static void main(String[] args) {         String str = "tutorialspoint";         // prints length of string         System.out.println("length of string = " + str.length());         // checks if the string is empty or not         System.out.println("is this string empty? = " + str.isEmpty());     } } Output length of string = 14 is this string empty? = false

Read More

Getting data in front-end tools from SAP HANA database

Anil SAP Gupta
Anil SAP Gupta
Updated on 30-Jul-2019 453 Views

In SAP HANA database, you have different system schema. _SYS_BIC schema in SAP HANA database is used to store column views of all the activated objects in HANA repository. When an object is created and activated (HANA Modeling views, Stored Procedures), run time objects are saved under _SYS_BIC/Column views in database.These column views are used by front-end tools like BusinessObjects to get the data in a query.

Read More

Updating configuration property file in SAP HANA Remote source

Anil SAP Gupta
Anil SAP Gupta
Updated on 30-Jul-2019 481 Views

Note that while modifying or creating the property configuration file, only the property which is different from default value needs to be set. The mistake in property configuration file may result in incorrect action or result of data source.

Read More

What does the method add(E element) do in java?

Nikitha N
Nikitha N
Updated on 30-Jul-2019 538 Views

The add(E e) method of the java.util.ArrayList class appends the specified element E to the end of the list.Example:import java.util.ArrayList; public class ArrayListDemo {    public static void main(String[] args) {       ArrayList arrlist = new ArrayList(5);       arrlist.add(15);       arrlist.add(20);       arrlist.add(25);       for (Integer number : arrlist) {          System.out.println("Number = " + number);       }    } }Output:Number = 15 Number = 20 Number = 25

Read More
Showing 60991–61000 of 61,297 articles
Advertisements