gpt4 book ai didi

java - 如何在整个应用程序中保持变量值相同?

转载 作者:行者123 更新时间:2023-12-01 15:55:26 25 4
gpt4 key购买 nike

我正在创建一个可以编辑内容的应用程序。现在,所有人都应该可以看到内容的变化。我为此使用了静态变量。随着内容的变化,变化对所有人都是可见的,但一段时间后,它会再次初始化为其初始值。

那么您能给我一些建议,让我可以在不使用数据库的情况下维护更改吗?

最佳答案

With that the content changes and change is visible to all but after sometime it again initialize to its initial value'

仅当您的 ClasLoader 重新加载包含静态属性的类时才会发生这种情况。

您可以选择 FILE-IO(.xml, .properties) 或 DB,

关于java - 如何在整个应用程序中保持变量值相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5166827/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com