![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
Found 9326 Articles for Object Oriented Programming
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
558 Views
An immutable copy of the LocalDate where the years are subtracted from it can be obtained using the minusYears() method in the LocalDate class in Java. This method requires a single parameter i.e. the number of years to be subtracted and it returns the instant with the subtracted years.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; public class Demo { public static void main(String[] args) { LocalDate ld1 = LocalDate.parse("2019-02-14"); System.out.println("The LocalDate is: " + ld1); LocalDate ld2 = ld1.minusYears(2); System.out.println("The LocalDate after subtracting ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
68 Views
Use the fromCollection() method to create a Decade tuple from a List collection in Java. Let us first see what we need to work with JavaTuples. To work with Decade class in JavaTuples, you need to import the following package.import org.javatuples.Decade;Note Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide for all the steps to run JavaTuples.Steps: How to run JavaTuples program in EclipseThe following is an example to create ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
54 Views
To add value in Ennead class in JavaTuples, you need to use the addAtX() method. Here, X represents the index wherein you need to add the value i.e. for index 2, use addAt2() method. Add the specific value as the parameter value of the method. For example −addAt2(“John”);Let us first see what we need to work with JavaTuples. To work with Ennead class in JavaTuples, you need to import the following package −import org.javatuples.Ennead;Note − Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
80 Views
The LongStream builder() class in Java is used to return a builder for a LongStream.The syntax is as follows.static LongStream.Builder builder()Here, LongStream.Builder is a mutable builder for a LongStream.To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;The following is an example to implement LongStream builder() method in Java.Example Live Demoimport java.util.stream.LongStream; public class Demo { public static void main(String[] args) { LongStream longStream = LongStream.builder().add(5).build(); longStream.forEach(System.out::println); } }Output5
![Nishtha Thakur](https://www.tutorialspoint.com/assets/profiles/13598/profile/60_104893-1512719058.jpg)
54 Views
The contains() method of the Ennead Tuple in Java is used to search for a value in the Tuple. To find the existence of a value, you need to just set it as a parameter of the method. It returns a boolean value i.e. TRUE is returned for the existence of a value, else FALSE.Let us first see what we need to work with JavaTuples. To work with Ennead class in JavaTuples, you need to import the following package −import org.javatuples.Ennead;Note − Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
53 Views
To search for a value in Ennead Tuple in Java, use the contains() method. The value you want to search is to be set as the parameter of the method. The contains() method returns a Boolean value i.e TRUE if the value exist, else FALSE. Let us first see what we need to work with JavaTuples. To work with Ennead class in JavaTuples, you need to import the following package −import org.javatuples.Ennead;Note − Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> Add External ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
75 Views
The setAtX() method is used to set Octet value in Java. Here, X is the index wherein you need to set the value i.e. to set value at index 1, use the setAt1() and value as a parameter.Let us first see what we need to work with JavaTuples. To work with Octet class in JavaTuples, you need to import the following package −import org.javatuples.Octet;Note − Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> Add External Jars and upload the downloaded JavaTuples jar file. ... Read More
![Nishtha Thakur](https://www.tutorialspoint.com/assets/profiles/13598/profile/60_104893-1512719058.jpg)
80 Views
You can easily iterate through Octet Tuple using a for the loop. Let us first see what we need to work with JavaTuples. To work with Octet class in JavaTuples, you need to import the following package −import org.javatuples.Octet;Note − Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide for all the steps to run JavaTuples −Steps − How to run JavaTuples program in EclipseThe following is an example to ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
57 Views
If you want to search whether a particular value exist in the Java Octet Tuple, you need to use the contains() method.For example, to find the element “Motherboard”, use it like this −boolean res = oc.contains("Motherboard");As shown above, we have used boolean i.e. the contains() method returns a boolean value; TRUE if the element is in the Tuple, else FALSE.Let us first see what we need to work with JavaTuples. To work with Octet class in JavaTuples, you need to import the following package −import org.javatuples.Octet;Note − Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
60 Views
To search for a value in Java Octet Tuple, you need to use the contains() method. The method returns a Boolean value stating whether the element set as a parameter exists in the values set in Octet Tuple or not. Let us first see what we need to work with JavaTuples. To work with Octet class in JavaTuples, you need to import the following package −import org.javatuples.Octet;Note − Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> Add External Jars and upload the downloaded ... Read More