
09-12-2005, 16:29
|
|
|
|
חבר מתאריך: 18.11.05
הודעות: 23
|
|
|
נ.ב., הערה נספחת לתרגיל:
בתגובה להודעה מספר 9 שנכתבה על ידי def11 שמתחילה ב "מכיוון שאני לא בטוח למה אתה מתכוון, יש 2 אופציות שאני רואה, לפי הבנתי,"
Working with Files and Strings
We provide you with a simple method that reads a complete file into a single String variable. You can the readFile() method to read your phones list file once in the beginning of the program, and then use that String variable throughout the program.
The Scanner class can also be useful in other places in this program: you can create a Scanner object which gets its input from a String, instead of from the keyboard, in a very similar manner. For example, assuming that phoneList is a variable of type String, you can use the following statement: Scanner scan = new Scanner (phoneList);This way, you can read lines from the phones list String variable one by one, or read tokens from some String representing a line. You may use several different Scanner objects for different tasks in your program.
אבל לא הצלחתי ליישם אתזה =\
_____________________________________
אל תדחו למחר מה שאפשר לדחות למחרתיים!
|