1:58 am - Tuesday April 23, 2019

Character Example Program for codePointCount(char[] a, int offset, int count)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**
*Character Example Program for codePointCount(char[] a, int offset, int count)
* @author   candidjava.com
* @description: this method gives an integer which specifies the number of  character Unicode codes which will be generated
if required by the method under the defined range inside the parentheses of the method.
*/

public class CodePoint
{
public static void main(String args[])
{

String str = "I'll leave this world soon without any worries";

//method count the indexes to the defined range
//it starts at first argument index in its count ignoring the secong argument index
int Total = str.codePointCount(4, 11);

System.out.println(" ");
System.out.println(Total + " is generated because method counts the first argument index up to before the second argument");

}
}

Output:

7 is generated because method counts the first argument index up to before the se
cond argument

Filed in: Z-A All Java Codes

Comments are closed.