Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10740 Articles
AmitDiwan
109 Views
The HTML DOM table deleteTHead() method delete the element from the table in an HTML document.SyntaxFollowing is the syntax −object.deleteTHead()Let us see an example of HTML DOM table deleteTHead() method −Example Live Demo body { color: #000; background: lightblue; ... Read More
AmitDiwan
513 Views
Let’s say we have set out inut string in myStr variable. Now loop through until the length of string and check for alphabets with ASCII values −for (int i = 0; i < myStr.length(); i++) { char c = myStr.charAt(i); if (!(c >= 'A' && c = 'a' && c = 'A' && c = 'a' && c
AmitDiwan
1K+ Views
At first, convert the string into character array. Here, name is our string −char[] ch = name.toCharArray();Now, loop through and find whether the string contains only alphabets or not. Here, we are checking for not equal to a letter for every character in the string −for (char c : ch) { ... Read More
AmitDiwan
806 Views
Let’s say our string is −String str = "Amit123";Now, using allMatch() method, get the boolean result whether the string has only alphabets or now −boolean result = str.chars().allMatch(Character::isLetter);Following is an example to check if a string contains only alphabets using Lambda Expressions −Exampleclass Main { public static void main(String[] ... Read More
AmitDiwan
749 Views
The HashMap class uses a hashtable to implement the Map interface. This allows the execution time of basic operations, such as get( ) and put( ), to remain constant even for large sets.Following is the list of constructors supported by the HashMap class.Sr.NoConstructor & Description1HashMap( )This constructor constructs a default ... Read More
AmitDiwan
116 Views
At first, create a Pair class −Pairpair = new Pair(Integer.valueOf(25), "green");Now, implement Triplet class with Pair class −Triplet triplet = pair.add("magenta");Following is an example to implement Triplet class with Pair class in Java −Exampleimport org.javatuples.Pair; import org.javatuples.Triplet; public class MyDemo { public static void main(String[] args) { ... Read More
AmitDiwan
127 Views
Following is an example to implement Pair class from Unit class in Java −Exampleimport org.javatuples.Unit; import org.javatuples.Pair; public class MyDemo { public static void main(String[] args) { Unit unit = Unit.with("Tutorial"); System.out.println("Unit class element: " + unit); Pair pair = ... Read More
AmitDiwan
676 Views
To sort an ArrayList, you need to use the Collections.sort() method. This sorts in ascending order, but if you want to sort the ArrayList in descending order, use the Collections.reverseOrder() method as well. This gets included as a parameter −Collections.sort(myList, Collections.reverseOrder());Following is the code to sort an ArrayList in descending ... Read More
AmitDiwan
107 Views
At first create Septet and add elements −Septet septet = new Septet( "Laptop", "Desktop", "Tablet", "Notebook", "Phone", "Reader", "LCD");Now, implement Octet from Septet −Octet octet = septet.add("LED");Following is an example to implement Octet class from Septet class in Java −Exampleimport org.javatuples.Septet; import org.javatuples.Octet; public class MyDemo { ... Read More
AmitDiwan
107 Views
Following is an example to implement Ennead class from Octet class in Java −Exampleimport org.javatuples.Octet; import org.javatuples.Ennead; public class MyDemo { public static void main(String[] args) { Octet octet = new Octet( "Jack", "Tom", "Steve", "Tim", "Nathan", "Ryan", ... Read More