- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
Create Unit Tuple in Java
To create a Unit Tuple in Java is quite easy.
Let us first see what we need to work with JavaTuples. To work with the Unit class in JavaTuples, you need to import the following package −
import org.javatuples.Unit;
Let us see an example.
Note − Steps to download and run JavaTuples program. If you are using Eclipse IDE to run Unit Class in Java Tuples, then Right Click Project ->Properties ->Java Build Path ->Add External Jars and upload the downloaded JavaTuples jar file.
Example
import org.javatuples.Unit; public class Demo { public static void main(String[] args) { Unit<String> u = new Unit<String>("This is demo text!"); System.out.println(u); } }
Output
[This is demo text!]
- Related Articles
- Create Unit Tuple from Array in Java
- Create Unit Tuple from List in Java
- Create Unit Tuple in Java using with() method
- Create Unit Tuple from another collection in Java
- Iterate through Java Unit Tuple
- Search a value in Java Unit Tuple
- Add a value to Unit Tuple in Java
- Java Tuple setAt0() method for Unit class
- The contains() method of Java Unit Tuple
- Create Pair Tuple in Java
- Create Triplet Tuple in Java
- Create Quartet Tuple in Java
- Create Quintet Tuple in Java
- Create Septet Tuple in Java
- Get a value from Unit Tuple class in Java

Advertisements