- 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
Krantik Chavan has Published 308 Articles
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
Krantik Chavan
73 Views
It can be checked if a particular MonthDay is after the other MonthDay in a timeline using the isAfter() method in the MonthDay class in Java. This method requires a single parameter i.e. the MonthDay object that is to be compared. It returns true if the MonthDay object is after ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
Krantik Chavan
565 Views
At first, get the current date:LocalDate listDays = LocalDate.now();Now, get the date for all the days of the current week:Arrays.asList(DayOfWeek.values()).stream().map(listDays::with).collect(toList()));Exampleimport java.time.DayOfWeek; import java.time.LocalDate; import java.util.Arrays; import static java.util.stream.Collectors.toList; public class Demo { public static void main(String[] args) { LocalDate listDays = LocalDate.now(); System.out.println("All ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
Krantik Chavan
217 Views
The most efficient want to check the presence of a row, use the count():select count(1) from yourTableName where yourCondition;Let us first create a table:mysql> create table DemoTable ( Id int, FirstName varchar(20) ); Query OK, 0 rows affected (0.73 sec)Following is the query to insert some records in ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
Krantik Chavan
2K+ Views
Let us first set a date:LocalDate localDate = LocalDate.of(2019, Month.JUNE, 15)Now, adjust LocalDate to last Day of month;LocalDate day = localDate.with(TemporalAdjusters.lastDayOfMonth());Exampleimport java.time.LocalDate; import java.time.Month; import java.time.temporal.TemporalAdjusters; public class Demo { public static void main(String[] args) { LocalDate localDate = LocalDate.of(2019, Month.JUNE, 15); System.out.println("Current ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
Krantik Chavan
739 Views
To update a range of records in MySQL, you can use BETWEEN. Let us first create a table:mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Name varchar(20), Age int ); Query OK, 0 rows affected (0.53 sec)Following is the query to insert some ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
Krantik Chavan
65 Views
It can be checked if a ChronoField is supported by the MonthDay class or not by using the isSupported() method in the MonthDay class in Java. This method requires a single parameter i.e. the ChronoField to check. It returns true if the ChronoField is supported by the MonthDay class and ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
Krantik Chavan
143 Views
Let’s say the following is our HashSet:HashSet set = new HashSet(); set.add("P"); set.add("Q"); set.add("R"); set.add("S"); set.add("T"); set.add("U"); set.add("V"); set.add("W"); set.add("X"); set.add("Z");Now convert the above HashSet to Enumeration:Enumeration enumeration = Collections.enumeration(set); while (enumeration.hasMoreElements()) System.out.println(enumeration.nextElement());Exampleimport java.util.Collections; import java.util.Enumeration; import java.util.HashSet; public class Demo { public static void main(String[] args) ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
Krantik Chavan
4K+ Views
Yes, we can ignore duplicate rows in COUNT using DISTINCT. Following is the syntax:select count(distinct yourColumnName) from yourTableName;In MySQL, COUNT() will display the number of rows. DISTINCT is used to ignore duplicate rows and get the count of only unique rows.Let us first create a table:mysql> create table DemoTable ( ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
Krantik Chavan
69 Views
It can be checked if a year is valid or not for a MonthDay object using the isValidYear() method in the MonthDay class in Java. This method requires a single parameter i.e. the year which is to be checked. Also, it returns true if the year is valid for a ... Read More
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
Krantik Chavan
394 Views
Let’s say you need to convert Instant to LocalDateTime with IST with timezone:Create an Instant:Instant instant = new Date().toInstant();Now, convert Instant to LocalDateTime:LocalDateTime date = LocalDateTime.ofInstant(instant, ZoneId.of(ZoneId.SHORT_IDS.get("IST")));Exampleimport java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Date; public class Demo { public static void main(String[] args) { Instant instant ... Read More