![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
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
3K+ Views
The month name for a particular LocalDate can be obtained using the getMonth() method in the LocalDate class in Java. This method requires no parameters and it returns the month name in the year.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; public class Demo { public static void main(String[] args) { LocalDate ld = LocalDate.parse("2019-02-14"); System.out.println("The LocalDate is: " + ld); System.out.println("The month is: " + ld.getMonth()); } }OutputThe LocalDate is: 2019-02-14 The month is: FEBRUARYNow let us understand the above program.First the LocalDate is displayed. ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
74 Views
To create LabelValue tuple from an array, use the fromArray() method. First, create an array and add elements to it. After that, use the fromArray() method to create a Tuple and set the array in it.Let us first see what we need to work with JavaTuples. To work with LabelValue class in JavaTuples, you need to import the following package −import org.javatuples.LabelValue;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 ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
65 Views
The concat() method in the LongStream class creates a concatenated stream whose elements are all the elements of the first stream followed by all the elements of the second stream.The syntax is as follows.static LongStream concat(LongStream one, LongStream two)Here, parameter one is the 1st stream, whereas two is the 2nd stream. The method returns the concatenation of both the streams.To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;Create a LongStrem and add some elements.LongStream streamOne = LongStream.of(100L, 150L, 300L, 500L);Now, create another stream.LongStream streamTwo = LongStream.of(200L, 250L, 400L, 600L, 550L);To concatenate both the above streams, use the ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
340 Views
The day of the year for a particular LocalDate can be obtained using the getDayOfYear() method in the LocalDate class in Java. This method requires no parameters and it returns the day of the year which can be in the range of 1 to 365 and also 366 for leap years.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; public class Demo { public static void main(String[] args) { LocalDate ld = LocalDate.parse("2019-02-14"); System.out.println("The LocalDate is: " + ld); System.out.println("The day of the year is: " + ld.getDayOfYear()); ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
76 Views
The count() method of the LongStream class in Java is used to return the count of elements in this stream.The syntax is as follows.long count()To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;Create a LongStream and add some elements.LongStream longStream = LongStream.of(50L, 30L, 80L, 40L, 15L, 60L);Now, get the count of elements.longStream.count()The following is an example to implement LongStream count() method in Java.Example Live Demoimport java.util.stream.LongStream; public class Demo { public static void main(String[] args) { LongStream longStream = LongStream.of(50L, 30L, 80L, 40L, 15L, 60L); System.out.println("The number of elements in the ... Read More
![Nishtha Thakur](https://www.tutorialspoint.com/assets/profiles/13598/profile/60_104893-1512719058.jpg)
64 Views
Create Decade Tuple in Java using a constructor or with() method. Here, we will see how to create a Decade of Tuple using constructor.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 ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
423 Views
The day of the month for a particular LocalDate can be obtained using the getDayOfMonth() method in the LocalDate class in Java. This method requires no parameters and it returns the day of the month which can be in the range of 1 to 31.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; public class Demo { public static void main(String[] args) { LocalDate ld = LocalDate.parse("2019-02-14"); System.out.println("The LocalDate is: " + ld); System.out.println("The day of the month is: " + ld.getDayOfMonth()); } }OutputThe LocalDate is: 2019-02-14 ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
21 Views
The distinct() method in the LongStream class returns a stream consisting of the distinct elements of this stream.The syntax is as follows.LongStream distinct()To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;Create a LongStream and add elements.LongStream longStream = LongStream.of(100L, 150L, 100L, 300L, 150L, 500L);Now, get the distinct elements.longStream.distinct().The following is an example to implement LongStream distinct() method in Java. Here, we have repeated elements in the stream.Example Live Demoimport java.util.stream.LongStream; public class Demo { public static void main(String[] args) { LongStream longStream = LongStream.of(100L, 150L, 100L, 300L, 150L, 500L); System.out.println("Distinct elements..."); ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
72 Views
A Decade class is a Tuple with 10 elements. It is in the JavaTuples library. The following is the declaration −public final class Decade extends Tuple implements IValue0, IValue1 , IValue2, IValue3, IValue4, IValue5, IValue6, IValue7, IValue8, IValue9Let 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. ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
154 Views
The day of the week for a particular LocalDate can be obtained using the getDayOfWeek() method in the LocalDate class in Java. This method requires no parameters and it returns the day of the week.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; public class Demo { public static void main(String[] args) { LocalDate ld = LocalDate.parse("2019-02-14"); System.out.println("The LocalDate is: " + ld); System.out.println("The day of the week is: " + ld.getDayOfWeek()); } }OutputThe LocalDate is: 2019-02-14 The day of the week is: THURSDAYNow let us understand ... Read More