如何做个免费的网站wordpress国内最好的主题
如何做个免费的网站,wordpress国内最好的主题,软件公司做网站吗,外贸公司经营范围大全locale()方法是java.util.Formatter的内置方法#xff0c;该方法返回语言环境。此区域设置由格式化程序构造设置。具有语言环境参数的该对象的format方法不会更改此值。用法#xff1a;public Locale locale()参数#xff1a;该函数不接受任何参数。返回值#xff1a;如果未…locale()方法是java.util.Formatter的内置方法该方法返回语言环境。此区域设置由格式化程序构造设置。具有语言环境参数的该对象的format方法不会更改此值。用法public Locale locale()参数该函数不接受任何参数。返回值如果未应用任何本地化则该函数返回null否则返回已初始化给格式化程序的语言环境。异常注意如果在调用函数之前关闭了格式化程序则该函数将引发FormatterClosedException。下面是上述功能的实现示例1:// Java program to implement// the above functionimport java.util.Formatter;import java.util.Locale;public class Main {public static void main(String[] args){// Get the string BufferStringBuffer buffer new StringBuffer();// Object creationFormatter frmt new Formatter(buffer,Locale.CANADA);// Format a new stringString name My name is Gopal Dave;frmt.format(What is your name? \n%s !,name);// Print the Formatted stringSystem.out.println(frmt);// Prints the format that has been set// Initially to the formatterSystem.out.println(Locale: frmt.locale());}}输出What is your name?My name is Gopal Dave !Locale: en_CA示例2:// Java program to implement// the above functionimport java.util.Formatter;import java.util.Locale;public class Main {public static void main(String[] args){try {// Get the string BufferStringBuffer buffer new StringBuffer();// Object creationFormatter frmt new Formatter(buffer,Locale.CANADA);// Format a new stringString name My name is Gopal Dave;frmt.format(What is your name? \n%s !,name);// Print the Formatted stringSystem.out.println(frmt);// Formatter closedfrmt.close();// Prints the format that has been set// Initially to the formatterSystem.out.println(Locale: frmt.locale());}catch (Exception e) {System.out.println(Exception is: e);}}}输出What is your name?My name is Gopal Dave !Exception is: java.util.FormatterClosedException
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/89802.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!