Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lab;
- import java.util.*;
- import java.io.*;
- public class Lab
- {
- public static void main(String[] args)
- {
- CUBA();
- }
- //METHOD TRY
- public static void CUBA(){
- String dir = "D:/UNIVERSITI MALAYA/Software Engineering (WES150009)/Fundamental of Programming [WIX1002]/Data file for Assignment/login.txt";
- try {
- PrintWriter text = new PrintWriter(new FileOutputStream(dir,true));
- Scanner defaultText = new Scanner(new FileInputStream(dir));
- text.close();
- String teks;
- while(defaultText.hasNextLine()){
- teks=defaultText.nextLine();
- System.out.println(teks);
- }
- //}
- defaultText.close();
- //Closing index.html write ability
- }
- catch(FileNotFoundException e){
- System.out.println("File Not Found");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement