
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2310 Articles

Samual Sam
130 Views
A Septet class is a Tuple of seven elements. It is part of the JavaTuples library.The following is the declaration −public final class Septet extends Tuple implements IValue1, IValue2, IValue3, IValue4, IValue5, IValue6, IValue7Let us first see what we need to work with JavaTuples. To work with Septet class in ... Read More

Samual Sam
2K+ Views
Let us first get the current date −LocalDate currentDate = LocalDate.now();Now, use the Calendar class and set the locale −Calendar cal = Calendar.getInstance(Locale.US);Now, get the month −int month = cal.get(Calendar.MONTH);Find the Quarter −int quarter = (month / 3) + 1;Exampleimport java.time.LocalDate; import java.util.Calendar; import java.util.Locale; public class Demo { ... Read More

Samual Sam
1K+ Views
You can use $pull operator for this. Let us first create a collection with documents −> db.removeNullDemo.insertOne( ... { ... "_id" : 1, ... "StudentDetails" : [ ... { ... "FirstName": "John", ... "LastName":"Smith", ... ... ... Read More

Samual Sam
324 Views
Cookies are text files stored on the client computer and they are kept for various information tracking purposes. JSP transparently supports HTTP cookies using underlying servlet technology.There are three steps involved in identifying and returning users -Server script sends a set of cookies to the browser. For example, name, age, ... Read More

Samual Sam
119 Views
Use the DATE_FORMAT(), not FORMATDATE() in MySQL to format date. The correct syntax is as follows −SE LECT *, DATE_FORMAT(yourDateCoumnName, ’yourFormat’) as anyAliasName FROM yourTableNameTo understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table DateFormatDemo -> ( ... Read More

Samual Sam
150 Views
The current instance of the clock with the default time zone can be obtained using the method systemDefaultZone() in the Clock Class in Java. This method requires no parameters and it returns the current instance of the clock with the default time zone.A program that demonstrates this is given as ... Read More

Samual Sam
214 Views
First, set the Date and ZoneId −Date date = new Date(); ZoneId zone = ZoneId.systemDefault();Now convert the java.util.date to localdate −date.toInstant().atZone(zone).toLocalDate() date.toInstant().atZone(zone).toLocalTime() date.toInstant().atZone(zone).getHour() date.toInstant().atZone(zone).getMinute() date.toInstant().atZone(zone).getSecond()Exampleimport java.time.ZoneId; import java.util.Date; public class Demo { public static void main(String[] args) { Date date = new Date(); ... Read More

Samual Sam
2K+ Views
Setting cookies with JSP involves three steps −Step 1: Creating a Cookie objectYou call the Cookie constructor with a cookie name and a cookie value, both of which are strings.Cookie cookie = new Cookie("key", "value");Keep in mind, neither the name nor the value should contain white space or any of ... Read More

Samual Sam
110 Views
The with() method is used to create Septet Tuple in Java.Let us first see what we need to work with JavaTuples. To work with Septet class in JavaTuples, you need to import the following package −import org.javatuples.Septet;Note − Steps to download and run JavaTuples program If you are using Eclipse ... Read More

Samual Sam
104 Views
The group is a type of method in MongoDB. It shouldn’t be created as a collection name. Even if you created it, you can easily remove it using getCollection('group').drop();). Let us first create a collection with documents −> db.createCollection('group'); { "ok" : 1 } > db.getCollection('group').insertOne({"StudentName":"Chris"}); { "acknowledged" : ... Read More