- 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
Karthikeya Boyini has Published 2383 Articles
karthikeya Boyini
181 Views
An immutable copy of the LocalDate where the days are subtracted from it can be obtained using the minusDays() method in the LocalDate class in Java. This method requires a single parameter i.e. the number of days to be subtracted and it returns the instant with the subtracted days.A program ... Read More
karthikeya Boyini
378 Views
Set the LocalDateTime to current datetime −LocalDateTime dateTime = LocalDateTime.now();Create an Instant −Instant i = dateTime.atZone(ZoneId.systemDefault()).toInstant(); Convert LocalDateTime to java.util.Date: java.util.Date date = Date.from(i);Example Live Demoimport java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Date; public class Demo { public static void main(String[] args) { LocalDateTime dateTime = LocalDateTime.now(); ... Read More
karthikeya Boyini
1K+ Views
If you try to create a table and the table name already exist then MySQL will give a warning message. Let us verify the concept.Here, we are creating a table that already exist −mysql> CREATE TABLE IF NOT EXISTS DemoTable ( CustomerId int, CustomerName varchar(30), CustomerAge ... Read More
karthikeya Boyini
524 Views
To check the read/write ratio, you need to use SHOW STATUS command. This will give all the ratios.Case 1 − The syntax is as follows to get the read/write ratio −SHOW STATUS LIKE ‘Com_%’;Case 2 − If you want the insert, update, select and delete ratio, use the below syntax ... Read More
karthikeya Boyini
58 Views
The addAtX() method is used to add a value to the Triplet Tuple. The index can be set here with the X i.e. the place where the value gets added.Let us first see what we need to work with JavaTuples. To work with Triplet class in JavaTuples, you need to ... Read More
karthikeya Boyini
609 Views
An immutable copy of the LocalDate where the months are subtracted from it can be obtained using the minusMonths() method in the LocalDate class in Java. This method requires a single parameter i.e. the number of months to be subtracted and it returns the instant with the subtracted months.A program ... Read More
karthikeya Boyini
411 Views
To avoid inserting duplicate rows in MySQL, you can use UNIQUE(). The syntax is as follows −ALTER TABLE yourTableName ADD UNIQUE(yourColumnName1, yourColumnName2, ...N);To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table avoidInsertingDuplicateRows -> ( -> Id ... Read More
karthikeya Boyini
564 Views
Let us first create an ArrayList −ArrayListarrList = new ArrayList(); arrList.add(10); arrList.add(50); arrList.add(100); arrList.add(150); arrList.add(250);Use Comparators interface to order in reverse order with reverseOrder() −Comparator comparator = Collections.reverseOrder(); Now, sort with Collections: Collections.sort(arrList, comparator);Example Live Demoimport java.util.ArrayList; import java.util.Collections; import java.util.Comparator; public class Demo { public static void main(String[] args) ... Read More
karthikeya Boyini
736 Views
Use the fromCollection() method to create a Pair Tuple from List collection.Let us first see what we need to work with JavaTuples. To work with Pair class in JavaTuples, you need to import the following package −import org.javatuples.Pair;Note − Steps to download and run JavaTuples program. If you are using ... Read More
karthikeya Boyini
115 Views
The tag is JSTL-friendly version of the setProperty action. The tag is helpful because it evaluates an expression and uses the results to set a value of a JavaBean or a java.util.Map object.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueInformation to saveNobodytargetName of the variable whose property should be ... Read More