Online Java Compiler By
JavaTpoint.com
public class JavaLongExample2 { public static void main(String [] args) { Long x1= 45l; Long x2= 67l; Long x3= 12l; // Adds the two values. System.out.println("The sum of '"+x1+ "' and '"+x2+"' 'is given as :"+Long.sum(x1, x2)); // Returns the value by reversing the order of nits in 2's complement. System.out.println("The reverse value for'" +x3+ "' is given as :"+Long.reverse(x3)); // Returns the string representation. String obj = x2.toString(); System.out.println("The string representation for '" +x2+ "' is given as : "+obj); } }
Output