long l = 12345L; //deprecated from Java 9, use valueOf for better performance String str = new Long(l).toString(); // str is '12345'