Tuesday 24 June 2014

valueOf (long l)

public static String valueOf(long l)
Returns the string representation of the long argument.

class StringValueOfLong{
 public static void main(String args[]){
  long var1 = 512, var2 = 514;
  
  String str1 = String.valueOf(var1);
  String str2 = String.valueOf(var2);
  
  System.out.println("str1 = " + str1);
  System.out.println("str2 = " + str2);
 }
}

Output
str1 = 512
str2 = 514



Prevoius                                                 Next                                                 Home

No comments:

Post a Comment