Samual Sam has Published 2310 Articles

Create temporary file in specified directory in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

3K+ Views

A temporary file in the specified directory can be created using the method java.io.File.createTempFile(). This method requires three parameters i.e. the prefix to define the file name, the suffix to define the file extension and the directory in which the temporary file is to be created. It also returns the ... Read More

CharBuffer get() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

138 Views

The value at the current position of the buffer is read and then incremented using the method get() in the class java.nio.CharBuffer. This method returns the value that is at the current buffer position. Also, the BufferUnderflowException is thrown if underflow situation occurs.A program that demonstrates this is given as ... Read More

LocalDateTime getDayOfYear() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

108 Views

The day of the year for a particular LocalDateTime can be obtained using the getDayOfYear() method in the LocalDateTime 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 ... Read More

What is cumulative acknowledgement?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

7K+ Views

In data communications, when a receiver receives a message, it sends an acknowledgement back to the sender to notify it about correct receipt of the message. Cumulative acknowledgement is a process in which the receiver sends a single acknowledgement in response to a finite number of frames received. Through this, ... Read More

MySQL GROUP BY date when using datetime?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

6K+ Views

To GROUP BY date while using datetime, the following is the syntax −select *from yourTableName GROUP BY date(yourColumnName);To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table groupByDateDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT ... Read More

Java Program to create a new list with values from existing list with Function Mapper

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

145 Views

To create a new list with values from fields from existing list with Function Mapper, the following is an example. Here, we have a class Employee −class Employee {    private String emp_name;    private int emp_age;    private String emp_zone; }The following is an example that creates a new ... Read More

Where is the MySQL table data stored in Windows?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

598 Views

In order to know the location of MySQL table data, you can use the below syntax −select @@datadir;You can also use SHOW VARIABLES command for this. Following is the syntax −show variables where Variable_name ='datadir';Let us implement the above syntaxes to know where MySQL table stores data −mysql> select @@datadir;This ... Read More

How to write a switch statement in a JSP page?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

2K+ Views

Following is the example of using a switch statement within a JSP page. Live Demo           SWITCH...CASE Example                   The above code will generate the following result −It's Wednesday.

Example Data Link Protocols

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

16K+ Views

The data link protocols operate in the data link layer of the Open System Interconnections (OSI) model, just above the physical layer.The services provided by the data link protocols may be any of the following −Framing − The stream of bits from the physical layer are divided into data frames ... Read More

AbstractSequentialList in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

135 Views

The Java Collection Framework contains the AbstractSequentialList class. This class is used to create and implement an unmodifiable list. Also this class implements the Collection interface and the AbstractCollection class.A program that demonstrates this is given as follows −Example Live Demoimport java.util.*; public class Demo {    public static void main(String[] ... Read More

Advertisements