gpt4 book ai didi

java - "Bundle"和 "/Bundle"的区别

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

有什么区别

ResourceBundle.getBundle("Bundle")

还有这个

ResourceBundle.getBundle("/Bundle")

最佳答案

来自the Java docs :

The baseName argument should be a fully qualified class name. However, for compatibility with earlier versions, Sun's Java SE Runtime Environments do not verify this, and so it is possible to access PropertyResourceBundles by specifying a path name (using "/") instead of a fully qualified class name (using ".").

第二种形式 将从文件系统加载 /Bundle.properties(可能在从默认语言环境附加一些修饰符之后)。 可能无法加载任何内容(提示一些实验计算机科学的 VGR 帽子)。最多它会尝试从当前目录或某个文件根目录加载 Bundle.properties

关于java - "Bundle"和 "/Bundle"的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24728027/

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