How to get Input from User in Java

import java.util.Scanner;

class getuserinput
{
public static void main(String args[])
{
int a;
float b;
String c;
System.out.println("Enter integer");
a = in.nextInt();
System.out.println("The Value is "+a);
Scanner in = new Scanner(System.in);
System.out.println("Enter float");
b = in.nextFloat();
System.out.println("The Value is "+b);  
System.out.println("Enter string");
c = in.nextLine();
System.out.println("The Value is "+c);
}
}

Java Code to Read Text File

import java.io.*;
class ReadFile
{
public static void main(String args[])
{
try{
FileInputStream fstream = new FileInputStream("C:\\java\\demo\\file.txt");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String Data;
while ((Data = br.readLine()) != null)   {
System.out.println (Data);
}
in.close();
}
catch (Exception e)
{
System.err.println("Error: " + e.getMessage());
}
}
}

Java Code to Send Email

package Javamails;

import javax.mail.*;
import java.util.*;

public class Javamail
{
public static void main(String[] args)throws MessagingException
{
String from = "udhaya1987devtest@gmail.com",
password = "",
host = "smtp.gmail.com",
port = "8000",
subject = "Hi",
message = "Hi Team";
Properties props = new Properties();
props.put("mail.smtp.user", from);
props.put("mail.smtp.host", host);
props.put("mail.smtp.port", port);
props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.socketFactory.port",port);
props.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.fallb","false");
SecurityManager security = System.getSecurityManager();
try
{
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
MimeMessage msg = new MimeMessage(session);
msg.setText(message);
msg.setSubject(subject);
msg.setFrom(new InternetAddress(from));
msg.addRecipient(Message.RecipientType.TO,new InternetAddress(to);
Transport.send(msg);
}
catch(Exception mex)
{
mex.printStackTrace();
}
}
}

class SMTPAuthenticator extends javax.mail.Authenticator
{
String from = "sender_id@gmail.com",
password = "password",
host = "smtp.gmail.com",
port = "8000",
subject = "Hi",
message = "Hi Team";
public PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication(from, password);
}
}
My Profile