Java tutorial
//package com.java2s; public class Main { public static boolean isAllEqualsString(String string) { char[] chars = string.toCharArray(); for (int i = 0; i < chars.length; i++) { if (i + 1 < chars.length) { if (chars[i] != chars[i + 1]) return false; } } return true; } }