➽ Program:-

import java.util.*;

class Main

{             

  public static void main(String args[])

  {

    String str;

    int num;

    float fnum;

   

    Scanner sc = new Scanner(System.in);

 

    //For String Input

    System.out.print("Enter a String: ");

    str = sc.nextLine();

    System.out.println("Result: "+str);

   

    //For Integer Input

    System.out.print("Enter an Integer: ");

    num = sc.nextInt();

    System.out.println("Result: "+num);

   

    //For Float Number Input

    System.out.print("Enter a Float Number: ");

    fnum = sc.nextFloat();

    System.out.println("Result: "+fnum);

  }

}

➽ Output:-

Enter a String: Coding Plaza
Result: Coding Plaza

Enter an Integer: 50
Result: 50

Enter a Float Number: 3.6
Result: 3.6