Convert Float to String in Java

karthikeya Boyini
Updated on 26-Jun-2020 08:21:49

9K+ Views

To convert float to string, use the toString() method. It represents a value in a string.Let’s say the following is our float.float f = 0.9F;Converting the float value to string.String s = Float.toString(f);Let us see the complete example to convert float to String in Java with output.Example Live Demopublic class Demo {    public static void main(String args[]) {       float f = 0.9F;       String s = Float.toString(f);       System.out.println(s);    } }Output0.9

Display the Day of the Week Using SimpleDateFormat in Java

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

668 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; import java.text.SimpleDateFormat; import java.util.Date;Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo {    public static void main(String[] args) throws Exception {       // displaying current date and time       Calendar cal = Calendar.getInstance();       SimpleDateFormat simpleformat = new SimpleDateFormat("dd/MMMM/yyyy hh:mm:s"); ... Read More

Get Full Day Name in Java

karthikeya Boyini
Updated on 26-Jun-2020 08:19:45

5K+ Views

To display the full day name, use the SimpleDateFormat(“EEEE”) as shown below −// displaying full-day name f = new SimpleDateFormat("EEEE"); String str = f.format(new Date()); System.out.println("Full Day Name = "+str);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 java.text.SimpleDateFormat; import java.util.Date;Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo {    public static void main(String[] args) throws Exception {       // displaying current date and time       Calendar cal = Calendar.getInstance();       SimpleDateFormat simpleformat = ... Read More

Bounce Out Down Animation Effect with CSS

karthikeya Boyini
Updated on 26-Jun-2020 08:19:10

119 Views

To implement Bounce Out Down 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;             background-position: left top;             padding-top:95px;             margin-bottom:60px;             -webkit-animation-duration: 10s;             animation-duration: 10s;             -webkit-animation-fill-mode: both;             animation-fill-mode: both;          }          @-webkit-keyframes bounceOutDown {             0% {                -webkit-transform: translateY(0);             }             20% {                opacity: 1;                -webkit-transform: translateY(-20px);             }             100% {                opacity: 0;                -webkit-transform: translateY(2000px);             }          }          @keyframes bounceOutDown {             0% {                transform: translateY(0);             }             20% {                opacity: 1;                transform: translateY(-20px);             }             100% {                opacity: 0;                transform: translateY(2000px);             }          }          .bounceOutDown {             -webkit-animation-name: bounceOutDown;             animation-name: bounceOutDown;          }                           Reload page                function myFunction() {             location.reload();          }          

mbrlen Function in C/C++

karthikeya Boyini
Updated on 26-Jun-2020 08:19:06

193 Views

The function mbrlen() is used to get the length of multibyte character. It returns the size of multibyte character pointed by the pointer.Here is the syntax of mbrlen() in C language, size_t mbrlen(const char* pointer, size_t size, mbstate_t* state);Here, pointer − Pointer to the first byte of multibyte character.size − Number of bytes to check.state − Pointer to the object of mbstate_tHere is an example of mbrlen() in C language, Example Live Demo#include #include #include int main(void) {    char a[] = "s";    mbstate_t s;    int len;    len = mbrlen(a, 5, &s);    printf("Length of ... Read More

Format Date with SimpleDateFormat (MM/dd/yy) in Java

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 java.text.SimpleDateFormat; import java.util.Date;Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo {    public static void main(String[] args) throws Exception {       // displaying current date and time       Calendar cal = Calendar.getInstance();       SimpleDateFormat simpleformat = new SimpleDateFormat("dd/MMMM/yyyy hh:mm:s");   ... Read More

isgraph C Library Function

karthikeya Boyini
Updated on 26-Jun-2020 08:17:52

151 Views

The function isgraph() is used to check that the passed character has a graphical representation or not. It is declared in “ctype.h” header file.Here is the syntax of isgraph() in C language, int isgraph(int char);Here is an example of isgraph() in C language, Example Live Demo#include #include int main() {    int a = '';    int b = '8';    int c = 's';    if(isgraph(a))    printf("The character has graphical representation");    else    printf("The character isn’t having graphical representation");    if(isgraph(b))    printf("The character has graphical representation");    else    printf("The character isn’t having graphical representation");    if(isgraph(c)) ... Read More

Bounce In Right Animation Effect with CSS

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;             background-position: left top;             padding-top:95px;             margin-bottom:60px;             -webkit-animation-duration: 10s;             animation-duration: 10s;             -webkit-animation-fill-mode: both;             animation-fill-mode: both;          }          @-webkit-keyframes bounceInRight {             0% {                opacity: 0;                -webkit-transform: translateX(2000px);             }             60% {                opacity: 1;                -webkit-transform: translateX(-30px);             }             80% {                -webkit-transform: translateX(10px);             }             100% {                -webkit-transform: translateX(0);             }          }          @keyframes bounceInRight {             0% {                opacity: 0;                transform: translateX(2000px);             }             60% {                opacity: 1;                transform: translateX(-30px);             }             80% {                transform: translateX(10px);             }             100% {                transform: translateX(0);             }          }          .bounceInRight {             -webkit-animation-name: bounceInRight;             animation-name: bounceInRight;          }                           Reload page                function myFunction() {             location.reload();          }          

Display Month Number with SimpleDateFormat in Java

karthikeya Boyini
Updated on 26-Jun-2020 08:16:50

3K+ Views

To display the month number, use the SimpleDateFormat(“M”)// displaying month number Format f = new SimpleDateFormat("M"); String strMonth = f.format(new Date()); System.out.println("Month Number = "+strMonth);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 java.text.SimpleDateFormat; import java.util.Date;Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo {    public static void main(String[] args) throws Exception {       // displaying current date and time       Calendar cal = Calendar.getInstance();       SimpleDateFormat simpleformat = new SimpleDateFormat("dd/MMMM/yyyy hh:mm:s");     ... Read More

CSS Background Origin Property

Chandu yadav
Updated on 26-Jun-2020 08:16:48

166 Views

The CSS background-origin property is used to specify position of the background images.ExampleYou can try to run the following code to implement background-origin property:Live Demo                    #demo {             border: 5px dashed red;             padding: 10px;             background-image: url("https://www.tutorialspoint.com/css/images/css-mini-logo.jpg");             background-origin: content-box;          }                              www.tutorialspoint.com          The website www.tutorialspoint.com ... Read More

Advertisements