Samual Sam has Published 2310 Articles

Java Program to return a Date set to the first possible millisecond of the day after midnight

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:24:18

130 Views

Let us first set the calendar object.Calendar calendar = Calendar.getInstance();Use the getMinimum() method in Java to return the minimum value for the given calendar field. We will use it to set the minute, hours second and milliseconds.For hour and minute.calendar.set(Calendar.HOUR_OF_DAY, calendar.getMinimum(Calendar.HOUR_OF_DAY)); calendar.set(Calendar.MINUTE, calendar.getMinimum(Calendar.MINUTE));For second and milliseconds.// second calendar.set(Calendar.SECOND, calendar.getMinimum(Calendar.SECOND)); // ... Read More

Display the day in week using SimpleDateFormat('E') in Java

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:20:51

664 Views

To display the day in week, use the SimpleDateFormat(“E”) as shown below −Format f = new SimpleDateFormat("E"); String strDayinWeek = f.format(new Date()); System.out.println("Day in week = "+strDayinWeek);Since, we have used the Format and SimpleDateFormat class above, therefore import the following packages. With that, we have also used the Date.import java.text.Format; ... Read More

Format date with SimpleDateFormat('MM/dd/yy') in Java

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:18:17

19K+ Views

Let us see how we can format date with SimpleDateFormat('MM/dd/yy')// displaying date Format f = new SimpleDateFormat("MM/dd/yy"); String strDate = f.format(new Date()); System.out.println("Current Date = "+strDate);Since, we have used the Format and SimpleDateFormat class above, therefore import the following packages. With that, we have also used the Date.import java.text.Format; import ... Read More

Bounce In Right Animation Effect with CSS

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:17:25

212 Views

To implement Bounce In Right Animation Effect with CSS, you can try to run the following code −ExampleLive Demo                    .animated {             background-image: url(/css/images/logo.png);             background-repeat: no-repeat;     ... Read More

Java Program to convert string value to float using Float.valueOf()

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:13:31

153 Views

The Float.valueOf() method is used in Java to convert string to float.The following are our string values.String str1 = "100.5"; String str2 = "200.5";To convert the string value to float, try the method valueOf()float val1 = (Float.valueOf(str1)).floatValue(); float val2 = (Float.valueOf(str2)).floatValue();The following is the complete example with output.Example Live Demopublic class ... Read More

Print 1 to 100 in C++, without loop and recursion

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:11:52

948 Views

There are several methods to print numbers without using loops like by using recursive function, goto statement and creating a function outside main() function.Here is an example to print numbers using goto statement in C++ language, Example Live Demo#include using namespace std; int main() {    int count=1;    int ... Read More

Java Program to convert Java String to Float Object

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:11:35

299 Views

To convert String to Float Object, you can use a method Float.valueOf() method or you can even achieve this without using the in-built method.Let us see both the examples.The following is an example that converts String to Float Object using Float.valueOf() method.Example Live Demopublic class Demo {    public static void ... Read More

isupper() function in C Language

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:10:38

2K+ Views

The function isupper() is used to check that the character is uppercase or not. It returns non-zero value if successful otherwise, return zero. It is declared in “ctype.h” header file.Here is the syntax of isupper() in C language, int isupper(int character);Here, character − The character which is to be checked.Here ... Read More

Set all the background image properties in one section with CSS

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:09:05

167 Views

The CSS background property is used to set all the background image properties in one section.ExampleYou can try to run the following code to implement the background property:Live Demo                    #demo {             background: lightblue url("https://www.tutorialspoint.com/css/images/css-mini-logo.jpg") ... Read More

memcpy() function in C/C++

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:08:37

6K+ Views

The function memcpy() is used to copy a memory block from one location to another. One is source and another is destination pointed by the pointer. This is declared in “string.h” header file in C language. It does not check overflow.Here is the syntax of memcpy() in C language, void ... Read More

Advertisements