import java.io.*;
import java.util.*;
class Keyboard2 {
public static void main(String[] args) throws IOException {
FileWriter fw= new FileWriter("datafile.txt");
PrintWriter pw= new PrintWriter(fw);
Scanner key= new Scanner(System.in);
System.out.println("Please enter a string");
String s1= key.nextLine();
pw.print("s1");
System.out.println();
System.out.println("Please enter an int");
int i= key.nextInt();
pw.print("i");
System.out.println();
System.out.println("Please enter another string");
String s2= key.nextLine();
pw.print("s2");
System.out.println();
System.out.println("Thank you, program ending...");
pw.close();
fw.close();
}
}
For some reason, when I run this, it won't let me enter anything for the second string. Help please?