Example | java.lang package | Character class | charCount() method



java.lang.Character.charCount()
java.lang.Character.charCount()


Signature
:
  


public static int charCount(int codePoint)

Description: 

Determines the number of char values needed to represent the specified character (Unicode code point). If the specified character is equal to or greater than 0x10000, then the method returns 2. Otherwise, the method returns 1.


Parameter:


codePoint - the character (Unicode code point) to be tested.


Since:


JDK1.5

Example:


This method has following 3 cases.
  1. If codePoint is less than 0X10000 or 65536. It returns 1.
  2. If codePoint is equal to 0X10000 or 65536. It returns 2.
  3. If codePoint is greater than 0X10000 or 65536. It returns 2.



References:



Thank you friends, I hope you have clearly understood this method. If you have any doubt, suggestion or query please feel free to comment below. You can also discuss it in our forum.

About Author:

I am simple guy with lot of ambitions. My main motive is to share whatever knowledge I have related to programming. With me you can easily learn how to solve any programming problem in Java.You can connect with me on social networking sites also.


Let's Get Connected: Linkedin | Facebook |

Example | java.lang package | Character class | charCount() method Example | java.lang package | Character class | charCount() method Reviewed by Rohit Agarwal on 8/28/2017 Rating: 5

No comments:

Please provide your valuable comments. If you have any suggestion please share with me I will work on it and if you have any question or doubt please ask, don't hesitate. I am your friend, i will clarify all your doubts.

Powered by Blogger.