🔒 Closed (JAVA) PATULONG PANO MAG MATCH NG TXT FILE!!!

Status
Not open for further replies.

Nero Swallowtail

Honorary Poster
so ganto kase dapat, ata, ewan ko kung possible to sa java, gumagawa po kase kami ng log in at sign up interface, bale pag nag sign up ka, ma i store ung i iinput mo sa isang file using IO Class, ang problema ko is kapag dalawang accounnt yung ginawa di tapos tinype ko ung naunang account na naka store sa txtfile di nababasa ni java, ung latest account lang ang na sa save, di ko kase kabisado tong IOClasses so di ko alam ibabato kong condition para mabasa nya ung file, pa help po please, kanina pa po kase deadline nakiusap nalang ako sa sir namin hehe
eto po ung code:
You do not have permission to view the full content of this post. Log in or register now.
 
ay mag e error pala yan sainyo, eto ung code para dun sa InvalidLetterException

Java:
public class InvalidLetterException extends Exception{
    public InvalidLetterException() {
          super("Invalid  Letter Detected");
    }
}
 
Check nyo po subukan nyo print yung get result ng login nyo bka di lng na detect yung sunod na strings.

First to do.
Get the strings from txt file.

Try to print values to console to check if line is detected.

create a String model to store arrays of strings.
match the stored string arrays using for loop.
 
File file = new File("abc.txt");
FileInputStream fin = new FileInputStream(file);
BufferedReader reader = new BufferedReader(fin);

List<String> list = new ArrayList<String>();
while((String str = reader.readLine())!=null){
list.add(str);
}

//convert the list to String array
String[] strArr = Arrays.toArray(list);


(Match Everything from created arrays)
private String[] toppings = {"Cheese", "Pepperoni", "Black Olives"};

// our constructor; print out the String array here
public JavaStringArrayTests1()
{
// old for loop
int size = toppings.length;
for (int i=0; i<size; i++)
{
System.out.println(toppings);
}
}
 
Status
Not open for further replies.

About this Thread

  • 8
    Replies
  • 461
    Views
  • 2
    Participants
Last reply from:
Arjienx

Trending Topics

Online now

Members online
1,043
Guests online
949
Total visitors
1,992

Forum statistics

Threads
2,274,923
Posts
28,959,366
Members
1,233,485
Latest member
senpaikatzu_88
Back
Top