Answer:
Java solution (because only major programming language that has public static methods)
(import java.io.* before hand)
public static boolean s2f(String fileName, String text){
try{
PrintWriter out = new PrintWriter(new File(fileName));
out.println(text);
out.close();
return true;
}
catch(Exception e){
return false;
}
}
Good job! please mark as branliest?!
C++:
int main () {
std::ofstream output {"greeting.txt"};
output << "hey!";
output.close();
return 0;
}
Anticipation I think so but I’m not sure:)