Character.UnicodeBlock类的()方法 (Character.UnicodeBlock Class of() method)

  • of() method is available in java.lang package.

    of()方法在java.lang包中可用。

  • of() method is used to return the Unicode block containing the given parameter value or it returns null when the given char value is not a part of a defined Unicode Block.

    of()方法用于返回包含给定参数值的Unicode块,或者在给定char值不属于已定义Unicode块的一部分时返回null。

  • of() method is a static method, it is accessible with the class name and if we try to access the method with the class object then we will not get any error.

    of()方法是一个静态方法,可以使用类名进行访问,如果尝试使用类对象访问该方法,则不会出现任何错误。

  • of() method does not throw an exception at the time of returning Unicode block.

    of()方法在返回Unicode块时不会引发异常。

Syntax:

句法:

    public static Character.UnicodeBlock of(Char value);

Parameter(s):

参数:

  • Char value – represents the character value.

    字符值 –表示字符值。

Return value:

返回值:

The return type of this method is Character.UnicodeBlock, it returns the following values based on the given cases,

此方法的返回类型为Character.UnicodeBlock ,它基于给定的情况返回以下值,

  • It returns the Unicode Block when the given char value is a part of any defined Unicode block.

    当给定的char值是任何已定义的Unicode块的一部分时,它将返回Unicode块。

  • It returns null when the given char value is not a part of any defined Unicode code block.

    当给定的char值不属于任何已定义的Unicode代码块时,它返回null。

Example:

例:

// Java program to demonstrate the example
// of Character.UnicodeBlock of(Char value)
// method of Character.UnicodeBlock class
public class Of {public static void main(String args[]) {// By using of(Char ch) method is to return the UnicodeBlock name
// containing the given char value
Character.UnicodeBlock ub1 = Character.UnicodeBlock.of('+');
Character.UnicodeBlock ub2 = Character.UnicodeBlock.of('u');
Character.UnicodeBlock ub3 = Character.UnicodeBlock.of('/');
Character.UnicodeBlock ub4 = Character.UnicodeBlock.of('a');
Character.UnicodeBlock ub5 = Character.UnicodeBlock.of('A');
// Display UnicodeBlock name
System.out.println("ub1 = " + ub1);
System.out.println("ub2 = " + ub2);
System.out.println("ub3 = " + ub3);
System.out.println("ub4 = " + ub4);
System.out.println("ub5 = " + ub5);
}
}

Output

输出量

ub1 = BASIC_LATIN
ub2 = BASIC_LATIN
ub3 = BASIC_LATIN
ub4 = BASIC_LATIN
ub5 = BASIC_LATIN

翻译自: https://www.includehelp.com/java/character-unicodeblock-of-method-with-example.aspx

Java Character.UnicodeBlock of()方法与示例相关推荐

  1. java散列法的运用实例,Java HashMap compute() 使用方法及示例

    Java HashMap compute() 使用方法及示例 Java HashMap compute()方法计算一个新值,并将其与哈希映射中的指定键相关联. compute()方法的语法为: has ...

  2. math的用法在java中的使用,Java Math cbrt() 使用方法及示例

    Java Math cbrt() 使用方法及示例 Java Math cbrt()方法返回指定数字的立方根. cbrt()方法的语法为: Math.cbrt(double num) 注意:cbrt() ...

  3. java arraylist 方法返回值,Java ArrayList get() 使用方法及示例

    Java ArrayList get() 使用方法及示例 Java ArrayList get()方法返回指定位置存在的元素. get()方法的语法为: arraylist.get(int index ...

  4. java kryo_Kryo框架使用方法代码示例

    Kryo框架的source已移至https://github.com/EsotericSoftware/kryo ,进入此页面,然后点击右边的Download Zip按钮,就能下载到最新版本的Kryo ...

  5. Java Math toIntExact() 使用方法及示例 long转int

    Java Math toIntExact()方法从指定的long参数返回int值. toIntExact()方法的语法为: Math.toIntExact(long value) 注意:toIntEx ...

  6. java readtimeout_Java HttpURLConnection.getReadTimeout方法代码示例

    import java.net.HttpURLConnection; //导入方法依赖的package包/类 /** * 得到响应对象 * * @param urlConnection * @retu ...

  7. java invalidate_Java Component.invalidate方法代码示例

    import java.awt.Component; //导入方法依赖的package包/类 /** Installs the component we will embed to display t ...

  8. java hasmoreelements_Java IOException.hasMoreElements方法代码示例

    import java.io.IOException; //导入方法依赖的package包/类 /** * fileName���� ���� package �������� ������ ���� ...

  9. java singletonlist_Java Collections singletonList()方法及示例

    集合类singletonList()方法 (Collections Class singletonList() method) singletonList() method is available ...

最新文章

  1. css表格文字超数量就竖排_绝了,超轻量级中文 OCR,你值得拥有
  2. 有用的sql(mysql)
  3. 实现对象的复用——享元模式
  4. 基于 OData 模型和 JSON 模型的 SAP UI5 表格控件行项目的添加和删除实现
  5. linux错误代码0x8008005,利用Windows10自带Linux学习(附带:0x8007019e错误解决方法)...
  6. MyEclipse配置Tomcat(图解)
  7. Bytecoin节点搭建
  8. Linux系统管理(8)——Ubuntu安装ssh服务 以及版本查看命令
  9. Ubuntu16.04+ROS Kinetic环境下svo编译运行
  10. 一文详解Python中的*可变参数与**关键字参数
  11. Unity3D视频教程,Unity3D从入门到精通视频教程
  12. HTML 做个漂亮的表格
  13. grads 相关系数_气象绘图软件GrADS高级使用技巧
  14. win下处理器组概念
  15. 自动生成_一键自动生成CAD图纸目录
  16. python批量查询ip归属地_python3.2批量查询IP地址区域
  17. 用 Java 实现一个远程控制客户端
  18. iqoo手机可以刷鸿蒙系统吗,华为老机型可以更新鸿蒙系统么-华为哪些老机型支持鸿蒙系统...
  19. 深度学习模型的Android部署方法
  20. 二叉树后序遍历非递归算法(详解)

热门文章

  1. java中报错convension_LambdaConversionException与泛型:JVM错误?
  2. java网络编程与分布式计算_Java网络编程与分布式计算
  3. java sort 第二个参数_详解java Collections.sort的两种用法
  4. Npm install failed with “cannot run in wd”
  5. React组件实现越级传递属性
  6. 我所知道的前端组件化与模块化
  7. 28. css样式中px转rem
  8. CSS3与页面布局学习笔记(二)——盒子模型(Box Model)、边距折叠、内联与块标签、CSSReset
  9. 《软件工程导论》课后习题解答
  10. 08 Spring框架 AOP (一)