Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道为什么以下编译:
Locale aLocale = new Locale.Builder().setLanguage("trollolo").setRegion("CA").build(); System.out.println(aLocale.getLanguage());
因为“trollolo”不是一种语言。为什么它不返回运行时异常,而是在调用时甚至返回“trollolo” getLanguage()?
getLanguage()
这是允许的行为。来自javadoc
Builder 仅检查单个字段是否满足语法要求(格式正确),但不验证值本身。
语法 (IETF BCP 47) 在用于识别语言的标签中定义
我有一个“日期时间”列,如下所示:2012-06-04 15:40:20.
2012-06-04 15:40:20
我想在 Doctrine 中创建一个查询,以获取以前的数据。小于2012-06-04 15:40:20。我怎么能在教义中意识到这一点。
对不起,我只是不知道。