Java: How can I read text and numbers from a file

后端 未结 3 857
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-12 02:24

I am creating a simple program to data read from a text file. The file stores information about a person, with the name, age and a number on each line:

Eg: File form

3条回答
  •  猫巷女王i
    2020-12-12 03:13

    If you want to do in this way, you can try doing like this :

    1. Fixing the way data will be present in the file, say

      firstName.lastName.age.number;

    2. Then you can write code to read data upto . and store it in a variable (you will be knowing what it is meant for) and after ";" there will be second entry.

提交回复
热议问题