- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
At first sort the array −int intArr[] = {55, 20, 10, 60, 12, 90, 59}; // sorting array Arrays.sort(intArr);Now, set the value to be searched in an int variable −int searchVal = 12;Check for the presence of a value in an array −int retVal = Arrays.binarySearch(intArr, searchVal); boolean res = retVal > 0 ? true : false;Following is an example to check if a value is present in an array −Exampleimport java.util.Arrays; public class Main { public static void main(String[] args) { // initializing unsorted int array int intArr[] = {55, 20, 10, ... Read More
Let’s say the string is −String str = "Malyalam";Let’s say the prefixes are in an array −String[] prefixArr = { "Ga", "Ma", "yalam" };Now, to check whether the string starts with any of the abive prefix, use the startsWith() −if (Stream.of(prefixArr) .anyMatch(str::startsWith)) System.out.println("TRUE"); else System.out.println("FALSE");Following is an example to check is a string starts with any of the given prefixes −Exampleimport java.util.stream.Stream; class Main { public static void main(String[] args) { String str = "Malyalam"; String[] prefixArr = { "Ga", "Ma", "yalam" }; if (Stream.of(prefixArr) ... Read More
The HTML DOM TableHeader abbr property returns and modify the value of abbr attribute of a table in an HTML document.SyntaxFollowing is the syntax −1. Returning abbrobject.abbr2. Adding abbrobject.abbr = “text”Let us see an example of abbr property:Example Live Demo body { color: #000; background: lightblue; height: 100vh; text-align: center; } table { margin: 2rem auto; width: 400px; } .btn { background: #db133a; border: none; height: 2rem; ... Read More
The HTML DOM TableRow Object represent the element of an HTML document.Create TableRow objectSyntaxFollowing is the syntax −document.createElement(“TR”);Properties of TableRow objectPropertyExplanationrowIndexIt returns the position of a row in the rows collection of a table.sectionRowIndexIt returns the position of a row in the rows collection of a thead, tbody, or tfoot.Methods of TableRow objectMethodExplanationdeleteCell()It removes a cell from the current table row.insertCell()It adds a cell into the current table row.Let us see an example of TableRow object:Example Live Demo body { color: #000; background: lightblue; height: 100vh; ... Read More
The HTML DOM TableHeader Object represent the element of an HTML document.Create TableHeader objectSyntaxFollowing is the syntax −document.createElement(“TH”);Properties of TableHeader objectPropertyExplanationcellIndexIt returns the position of a cell in the cell collection of a table row.colSpanIt returns and alter the value of colspan attribute of a table.headersIt returns and alter the value of headers attribute of a table.abbrIt returns and alter the value of abbr attribute of a table.rowSpanIt returns and alter the value of rowspan attribute of a tableLet us see an example of TableHeader object:Example Live Demo body { color: #000; ... Read More
The HTML DOM TableData Object represent the element of an HTML document.Create TableData objectSyntaxFollowing is the syntax −document.createElement(“TD”);Properties of TableData objectPropertyExplanationcellIndexIt returns the position of a cell in the cell collection of a table row.colSpanIt returns and alter the value of colspan attribute of a table.headersIt returns and alter the value of headers attribute of a table.rowSpanIt returns and alter the value of rowspan attribute of a table.Let us see an example of TableData object −Example Live Demo body { color: #000; background: lightblue; height: 100vh; ... Read More
The HTML DOM TableData rowSpan property returns and modify the value of rowspan attribute of a table in an HTML document.SyntaxFollowing is the syntax −1. Returning rowSpanobject.rowSpan2. Adding rowSpanobject.rowSpan = “number”Let us see an example of rowSpan property −Example Live Demo body { color: #000; background: lightblue; height: 100vh; text-align: center; } table { margin: 2rem auto; width: 400px; } .btn { background: #db133a; border: none; height: ... Read More
The HTML DOM table tHead property returns the element of the table in an HTML document.SyntaxFollowing is the syntax −object.tHeadLet us see an example of HTML DOM table tHead property −Example Live Demo body { color: #000; background: lightblue; height: 100vh; text-align: center; } table { margin: 2rem auto; } caption { color: #db133a; } .btn { background: #db133a; border: none; height: 2rem; ... Read More
The HTML DOM table tFoot property returns the element of the table in an HTML document.SyntaxFollowing is the syntax −object.tFootLet us see an example of HTML DOM table tFoot property −Example Live Demo body { color: #000; background: lightblue; height: 100vh; text-align: center; } table { margin: 2rem auto; } .btn { background: #db133a; border: none; height: 2rem; border-radius: 2px; width: 40%; ... Read More
The HTML DOM table tBodies Collection returns a collection of all elements in a table in an HTML document.SyntaxFollowing is the syntax −object.tBodiesProperties of tBodies CollectionPropertyExplanationlengthIt returns the number of elements in the collection in an HTML documentProperties of tBodies CollectionMethodExplanation[index]It returns the specified index element from the collection.item(index)It returns the specified index element from the collection.namedItem(id)It returns the specified id element from the collection.Let us see an example of HTML DOM table tBodies Collection −Example Live Demo body { color: #000; background: lightblue; ... Read More
To Continue Learning Please Login
Login with Google