AmitDiwan has Published 10744 Articles

MySQL query to check if a string contains a value (substring) within the same row?

AmitDiwan

AmitDiwan

Updated on 24-Sep-2019 12:36:49

996 Views

Since we need to match strings from the same row, use LIKE operator. Let us first create a table −mysql> create table DemoTable (    FirstName varchar(100),    FullName varchar(100) ); Query OK, 0 rows affected (0.53 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More

HTML oninvalid Event Attribute

AmitDiwan

AmitDiwan

Updated on 24-Sep-2019 12:28:09

282 Views

The HTML oninvalid event attribute is triggered when an input field is invalid while submitting the form in an HTML document.SyntaxFollowing is the syntax −ExampleLet us see an example of HTML oninvalid event Attribute −    body {       color: #000;       height: ... Read More

HTML oninput Event Attribute

AmitDiwan

AmitDiwan

Updated on 24-Sep-2019 12:25:46

345 Views

The HTML oninput event attribute is triggered when the user enters input in an input/textarea HTML element in an HTML document.SyntaxFollowing is the syntax −ExampleLet us see an example of HTML on input event Attribute −    body {       color: #000;       ... Read More

HTML Screen width Property

AmitDiwan

AmitDiwan

Updated on 24-Sep-2019 11:42:48

307 Views

The HTML Screen width property returns the total width of the user’s screen.SyntaxFollowing is the syntax −screen.widthExampleLet us see an example of HTML Screen width Property −    body {       color: #000;       height: 100vh;       background-color: #FBAB7E;       ... Read More

Stream.Builder build() in Java

AmitDiwan

AmitDiwan

Updated on 24-Sep-2019 08:46:12

1K+ Views

The build() method of the Stream.Builder class builds the stream, transitioning this builder to the built state. The syntax is as follows −Stream build()Following is an example to implement the build() method of the Stream.Builder class −Exampleimport java.util.stream.Stream; public class Demo {    public static void main(String[] args) {   ... Read More

Stream sorted() in Java

AmitDiwan

AmitDiwan

Updated on 24-Sep-2019 08:44:05

466 Views

The Stream sorted() in Java returns a stream consisting of the elements of this stream, sorted according to natural order.Following is the syntax −Stream sorted()Here, Stream is an interface in java.util.stream and is the type parameter in stream. This method returns the new stream.Following is an example to implement ... Read More

Java floor() method with Examples

AmitDiwan

AmitDiwan

Updated on 24-Sep-2019 08:42:09

260 Views

The java.lang.Math.floor() returns the largest (closest to positive infinity) double value that is less than or equal to the argument and is equal to a mathematical integer. Special cases −If the argument value is already equal to a mathematical integer, then the result is the same as the argument.If the argument is ... Read More

Java sqrt() method with Examples

AmitDiwan

AmitDiwan

Updated on 24-Sep-2019 08:38:10

278 Views

The java.lang.Math.sqrt(double a) returns the correctly rounded positive square root of a double value. Special cases −If the argument is NaN or less than zero, then the result is NaN.If the argument is positive infinity, then the result is positive infinity.If the argument is positive zero or negative zero, then the result ... Read More

How to Clone a Map in Java

AmitDiwan

AmitDiwan

Updated on 24-Sep-2019 08:35:09

486 Views

The java.util.HashMap class is the Hash table based implementation of the Map interface. To clone a Map in Java, use the clone() method.ExampleLet us see an example to clone a Map −import java.util.*; public class HashMapDemo {    public static void main(String args[]) {       // create two hash maps ... Read More

How to Clone a List in Java?

AmitDiwan

AmitDiwan

Updated on 24-Sep-2019 08:34:05

413 Views

To clone a list in Java, the easiest way is using the ArrayList.clone() method −Exampleimport java.util.ArrayList; public class Demo {    public static void main(String args[]) {       // create an empty array list       ArrayList arrlist1 = new ArrayList();       // use add ... Read More

Advertisements