java count occurrences of character in string

java count occurrences of character in string
r‮:ot refe‬lautturi.com
/**
 * @author lautturi.com
 * Java example: count occurrences of character in string java 
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		String str = "hello lautturi java world!";
		
		long count = str.chars().filter(ch -> ch == 'a').count();
		 
		long count2 = str.codePoints().filter(ch -> ch == 'u').count();
		
		System.out.println("a occurs "+count+" times ");
		System.out.println("u occurs "+count2+" times ");

	}
}

output:

a occurs 3 times 
u occurs 2 times
Created Time:2017-09-04 07:24:43  Author:lautturi