Online Java Compiler By
JavaTpoint.com
import java.util.Scanner; public class FloatToStringExample2 { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); System.out.print("Enter your password:"); Float f1 =scanner.nextFloat(); //calling static toString() method String f2 = Float.toString(f1); System.out.println("Your password + 18 = "+f2+18); } }
Output