- Trending Categories
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
Search a value in Java Unit Tuple
To search a value in Unit class in JavaTuples, use the contains() method.
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;
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.
The following is an example −
Example
import org.javatuples.Unit; public class Demo { public static void main(String[] args) { Unit < String > u = Unit.with("Kate!"); // Search for an element boolean valSearch = u.contains("Kate!"); System.out.println("Is the value in the Unit? " + valSearch); } }
Output
Is the value in the Unit? True
- Related Articles
- Search a value in Java Pair Tuple
- Add a value to Unit Tuple in Java
- Search for a value in Java Decade Tuple
- Search for a value in Java KeyValue Tuple
- Search for a value in Java Octet Tuple
- Search for a value in Java LabelValue Tuple
- Get a value from Unit Tuple class in Java
- How to search for a value in Java Ennead Tuple
- Create Unit Tuple in Java
- Iterate through Java Unit Tuple
- Create Unit Tuple from List in Java
- Create Unit Tuple from Array in Java
- Create Unit Tuple in Java using with() method
- Create Unit Tuple from another collection in Java
- Java Tuple setAt0() method for Unit class

Advertisements