Example usage for java.lang String valueOf

List of usage examples for java.lang String valueOf

Introduction

In this page you can find the example usage for java.lang String valueOf.

Prototype

public static String valueOf(double d) 

Source Link

Document

Returns the string representation of the double argument.

Usage

From source file:MainClass.java

public static void main(String[] arg) {
    int b = 12;
    System.out.println(String.valueOf(b));

}

From source file:MainClass.java

public static void main(String[] arg) {
    byte b = 12;
    System.out.println(String.valueOf(b));

}

From source file:MainClass.java

public static void main(String[] arg) {
    long b = 12L;
    System.out.println(String.valueOf(b));

}

From source file:MainClass.java

public static void main(String[] arg) {
    short f = 12;
    System.out.println(String.valueOf(f));

}

From source file:MainClass.java

public static void main(String[] args) {
    String s = String.valueOf(false);
    System.out.println(s);/*  w ww. jav a  2s .  com*/

    s = String.valueOf('A');
    System.out.println(s);

    char[] c = { 'a', 'b', 'c' };

    s = String.valueOf(c);
    System.out.println(s);

    s = String.valueOf(c, 0, 2);
    System.out.println(s);

    s = String.valueOf(3.5d);
    System.out.println(s);

    s = String.valueOf(2.5f);
    System.out.println(s);

    s = String.valueOf(59);
    System.out.println(s);

    s = String.valueOf(8000l);
    System.out.println(s);
}

From source file:MainClass.java

public static void main(String[] arg) {
    float f = 12.13145F;
    System.out.println(String.valueOf(f));

}

From source file:MainClass.java

public static void main(String[] arg) {
    double f = 12.13145D;
    System.out.println(String.valueOf(f));

}

From source file:Main.java

public static void main(String args[]) {

    int integerValue = 7;
    System.out.printf("int = %s\n", String.valueOf(integerValue));
}

From source file:Main.java

public static void main(String[] arg) {
    char[] ch = { 'a', 'b', 'c', 'd' };
    System.out.println(String.valueOf(ch));

}

From source file:Main.java

public static void main(String args[]) {
    char characterValue = 'Z';
    System.out.printf("char = %s\n", String.valueOf(characterValue));

}