import java.io.IOException;
import java.util.*;
public class Owner {
public static Scanner sc = new Scanner(System.in);
public static void main(String args[]) throws IOException {
String n = sc.nextLine();
Info.namec(n);
}
}
This is the second class, which is supposed to be printing the "HELLO" in the text file.
import java.io.*;
public class Info {
public static void namec(String n) throws IOException//name check
{
File f = new File("TEXT");
FileWriter fw = new FileWriter(f);
fw.write("HELLO!");
}
}
This code is not working, nothing is being typed in the text file. There are 2 classes, the "Hello" is not being printed.
fw.close();
Owner
class has to do with the question?