Java向文本文件添加控制台输入
我有一个关于爪哇io*的问题。
我如何将内容输入到Java控制台中,后者将其添加到链接到的Java文件后。
问题是我需要创建一个人数据库,为此我可以通过电子邮件,号码等创建一个新的人(当然,只有当我可以使用此信息时,我才能创建该人的个人资料。 我知道如何将文本文件链接到我的Java文件并在控制台中显示其内容,但是为了做到这一点,我只知道如何将输出添加到Java源代码中。但是我需要能够在控制台中创建新的人条目。
简单说:我是银行经理,只有控制台可以创建一个新的人数据库,但我无法访问源代码。我希望这里的问题很清楚。提前致谢。
I have a question regarding java io*.
How can I input things into the java console, which after inputting gets added to the java file linked to.
The problem is that I need to create a people database, for which I can create a new Person, with email, number etc (of course only if this information is available to me, so that I can create that person's profile.
I know how to link a text file to my java file and also display the content of it in the console, but in order to do that I only know how to add that output to the java source code. But I need to be able to create new persons entries in the console.
Easy said: I am a bank manager and only have the console to create a new people database but I do not have access to the source code. I hope the problem here is clear. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是100%确定的,但我假设:
这是Java中常见的用例,请检查此示例。
例如,您有很多选择可以实现这一目标
:从输入创建对象。
您也可以在循环时或循环创建,直到给定命令不好为止。
希望我能理解您的问题。
Not 100% sure, but I assume:
It is a common use case in Java, please check this example.
You have many options basically to achieve this, for example:
If you manage to understand this, and so read a line from input, then you can check this name, or command, you can create if/else, and other instructions and you can create objects from the inputs.
You can also create while or for loops until the given command is not good.
I hope I understand good your question.