Karthikeya Boyini has Published 2383 Articles

LocalDate hashCode() method in Java

karthikeya Boyini

karthikeya Boyini

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

197 Views

The hash code value of the LocalDate can be obtained using the hashCode() method in the LocalDate class in Java. This method requires no parameters and it returns the hash code value of the LocalDate.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Main { ... Read More

Java Program to sort a subset of array elements

karthikeya Boyini

karthikeya Boyini

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

224 Views

Let us first create a string array −String[] strArr = new String[] { "r", "p", "v", "y", "s", "q" };Now, use Arrays.sort() to get the subset. Use the following to sort only from the index range 2 to 6.Arrays.sort(strArr, 2, 6);Example Live Demoimport java.util.Arrays; public class Demo {    public static ... Read More

How to format percentages in JSP?

karthikeya Boyini

karthikeya Boyini

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

453 Views

The tag is used to format numbers, percentages, and currencies.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueNumeric value to displayYesNonetypeNUMBER, CURRENCY, or PERCENTNoNumberpatternSpecify a custom formatting pattern for the output.NoNonecurrencyCodeCurrency code (for type = "currency")NoFrom the default localecurrencySymbolCurrency symbol (for type = "currency")NoFrom the default localegroupingUsedWhether to group numbers ... Read More

C Program to find size of a File

karthikeya Boyini

karthikeya Boyini

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

2K+ Views

This is a C Program to find size of a File.AlgorithmBegin    function findfileSize()    Open a file pointer fp in read only mode.    If fp is equals to null then       Print “File not found” and return -1.    Else count the file size.     ... Read More

What is a scriptlet in JSP and what is its syntax?

karthikeya Boyini

karthikeya Boyini

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

1K+ Views

A scriptlet can contain any number of JAVA language statements, variable or method declarations, or expressions that are valid in the page scripting language.Following is the syntax of Scriptlet −You can write the XML equivalent of the above syntax as follows − code fragment Any text, HTML ... Read More

LocalDateTime getDayOfWeek() method in Java

karthikeya Boyini

karthikeya Boyini

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

112 Views

The day of the week for a particular LocalDateTime can be obtained using the getDayOfWeek() method in the LocalDateTime class in Java. This method requires no parameters and it returns the day of the week.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Demo { ... Read More

Java Program to convert array to String for one dimensional and multi-dimensional arrays

karthikeya Boyini

karthikeya Boyini

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

284 Views

For converting array to 1D and 2D arrays, let us first create a one-dimensional and two-dimensional array −One-DimensionalString str[] = {"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};Two-Dimensionaldoubled [][]= {    {1.2, 1.3, 2.1, 4.1},    {1.5, 2.3},    {2.5, 4.4},    {3.8},    {4.9},    {3.2, ... Read More

Get a value from Quartet class in JavaTuples

karthikeya Boyini

karthikeya Boyini

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

115 Views

The getValueX() method is used to get a value from Quartet Tuple class in Java at a particular index. For example, getValue0().Let us first see what we need to work with JavaTuples. To work with Quartet class in JavaTuples, you need to import the following package −import org.javatuples.Quartet;Note − Steps ... Read More

LocalDateTime getMonthValue() method in Java

karthikeya Boyini

karthikeya Boyini

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

73 Views

The month of the year is obtained using getMonthValue() method in the LocalDateTime class in Java. This method requires no parameter and it returns the month of the year which may be in the range of 1 to 12.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; ... Read More

How to append text to a text file in C++?

karthikeya Boyini

karthikeya Boyini

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

7K+ Views

This is a C++ program to append text to a text file.AlgorithmBegin    Open that file a1.txt as output file stream class object to perform    output operation in append mode using fout file reference.    If the file exists then       Appending text to that file.   ... Read More

Advertisements