Constructors of StringBuilder Class in Java

Manikanth Mani
Updated on 30-Jul-2019 22:30:21

381 Views

The StringBuilder class of the java.lang package is a mutable sequence of characters. This provides an API compatible with StringBuffer, but with no guarantee of synchronization. Following are the list of constructors provided by the StringBuilder class.S.N.Constructor & Description1StringBuilder()This constructs a string builder with no characters in it and an initial capacity of 16 characters.2StringBuilder(CharSequence seq)This constructs a string builder that contains the same characters as the specified CharSequence.3StringBuilder(int capacity)This constructs a string builder with no characters in it and an initial capacity specified by the capacity argument.4StringBuilder(String str)This constructs a string builder initialized to the contents of the specified string. ... Read More

Delete Data from MySQL Table using PHP Script

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

393 Views

We can use the SQL DELETE command with or without the WHERE CLAUSE into the PHP function – mysql_query(). This function will execute the SQL command in a similar way it is executed at the mysql> prompt. To illustrate it we are having the following example − Example In this example, we are writing a PHP script to delete a record from MySQL table named ‘tutorial_tbl’ whose tutorial_id as 3.

Java String isEmpty Method Example

Rama Giri
Updated on 30-Jul-2019 22:30:21

186 Views

The isEmpty() method of the String class returns true if the length of the current string is 0.Example Live Demoimport 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());    } }Outputlength of string = 14 is this string empty? = false

Create MySQL View with GROUP BY Clause

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

2K+ Views

We can use GROUP BY to group values from a column, and, if we want, we can perform calculations on that column. You can use COUNT, SUM, AVG, etc., functions on the grouped column. To understand GROUP BY clause with views we are creating a view named ‘Info’ using the base table ‘Student_info’ having the following data − mysql> Select * from Student_info; +------+---------+------------+------------+ | id | Name | Address | Subject | +------+---------+------------+------------+ | 101 | YashPal | Amritsar | History ... Read More

Find Index of Element in Java List

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

15K+ Views

The indexOf(Object) method of the java.util.ArrayList class returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. Using this method, you can find the index of a given element.Example Live Demoimport java.util.ArrayList; public class ArrayListDemo {    public static void main(String[] args) {       ArrayList arrlist = new ArrayList(5);       arrlist.add("G");       arrlist.add("E");       arrlist.add("F");       arrlist.add("M");       System.out.println("Size of list: " + arrlist.size());       for (String value : arrlist) {       ... Read More

Using Smart Data Access (SDA) in SAP HANA

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

823 Views

Smart Data Access under Provisioning tab allows you to access and analyze the data stored in other database systems without replicating the data into HANA database. Data replication process is always time consuming and requires memory storage. Smart Data Access allows you to create virtual tables which are linked to remote system tables and data can be directly accessed in SAP HANA system with these virtual tables.You can manipulate these virtual tables and run SQL statements- SELECT, INSERT and UPDATE and even Join is permissible between virtual and local tables. When a JOIN is applied on virtual tables, SAP HANA ... Read More

Drawbacks of Using a Test Database

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

225 Views

There is a database named test in the list of databases displayed by the statement SHOW DATABASES. We can use test database but the main disadvantage is that anything created in this database can be removed/changed by anyone else with access to it. To avoid this we should take permission from MySQL administrator to use a database of our own. For taking permission following command must be run − mysql> grant all on tutorial.* to root@localhost; Query OK, 0 rows affected (0.10 sec) In the above command, I am taking permission for the tutorial database. Root is the ... Read More

Use of SAP Host Agent in SAP HANA

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

816 Views

To manage software updates and patch management in HANA system environment, you should install SAP Host Agent on all the machines that are part of SAP system landscape. SAP Host Agent is used by Software Update Manager to install the software patches on all the component servers in your system landscape.

Iterate Over a Java List

Abhinaya
Updated on 30-Jul-2019 22:30:21

12K+ Views

Often, you will want to cycle through the elements in a collection. For example, you might want to display each element.The easiest way to do this is to employ an iterator, which is an object that implements either the Iterator or the ListIterator interface.Iterator enables you to cycle through a collection, obtaining or removing elements. ListIterator extends Iterator to allow bidirectional traversal of a list and the modification of elements.Before you can access a collection through an iterator, you must obtain one. Each of the collection classes provides an iterator() method that returns an iterator to the start of the ... Read More

Methods of StringBuilder Class in Java

Anjana
Updated on 30-Jul-2019 22:30:21

297 Views

Following are the various constructors provided by the StringBuilder class.S.N.Constructor & Description1StringBuilder()This constructs a string builder with no characters in it and an initial capacity of 16 characters.2StringBuilder(CharSequence seq)This constructs a string builder that contains the same characters as the specified CharSequence.3StringBuilder(int capacity)This constructs a string builder with no characters in it and an initial capacity specified by the capacity argument.4StringBuilder(String str)This constructs a string builder initialized to the contents of the specified string.

Advertisements