/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author HENRIQUE
*/
public class Main {
public static void main(String[] args) {
EscreverPalavras es = new EscreverPalavras();
es.escreve("Wello World!");
}
}
import java.io.FileOutputStream;
import java.io.PrintWriter;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author HENRIQUE
*/
public class EscreverPalavras {
public void escreve(Object texto){
try {
FileOutputStream arq = new FileOutputStream("arquivo.asm");
PrintWriter tk = new PrintWriter(arq);
tk.print(texto);
tk.close();
} catch (Exception e) {
System.out.println("ERRO !"+e.getMessage());
}
}
}
Wello World!