- 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
AmitDiwan has Published 11365 Articles
AmitDiwan
66 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
54 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
541 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
55 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
59 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
AmitDiwan
64 Views
Following is an example to implement Decade Class from Ennead Class in Java using JavaTuples −Exampleimport org.javatuples.Decade; import org.javatuples.Ennead; public class MyDemo { public static void main(String[] args) { Ennead e = Ennead.with("Katie", "Tom", "Ryan", "Tom", "Bradley", "David", "Steve", "Brad", "Jacob"); ... Read More
AmitDiwan
8K+ Views
To sort TreeSet in descending order, use the descendingSet() method in Java.The descendingSet() method is used to return a reverse order view of the elements contained in this set.At first, create a TreeSet −TreeSet treeSet = new TreeSet();Then add some elements −treeSet.add(45); treeSet.add(15); treeSet.add(99); treeSet.add(70);Sort them indecreasing order −TreeSet res = (TreeSet)treeSet.descendingSet();Following ... Read More
AmitDiwan
1K+ Views
To sort HashSet in Java, you can use another class, which is TreeSet.Following is the code to sort HashSet in Java −Example Live Demoimport java.util.*; public class Main { public static void main(String args[]) { Set hashSet = new HashSet(); hashSet.add("green"); ... Read More
AmitDiwan
844 Views
To sort an ArrayList in ascending order, the easiest way is to the Collections.sort() method. With this method, you just need to set the ArrayList as the parameter as shown below −Collections.sort(ArrayList)Let us now see an example to sort an ArrayList un ascending order. Here, we are sorting ArrayList with ... Read More
AmitDiwan
51 Views
The HTML DOM table deleteTFoot() method delete the element from the table in an HTML document.SyntaxFollowing is the syntax −object.deleteTFoot()Let us see an example of HTML DOM table deleteTFoot() method −Example Live Demo body { color: #000; background: lightblue; ... Read More