[Solved] JAVA string how can i implement the length method


Something like this?

int i = 0;
for (char ch : string.toCharArray()) {
  i++;
}

4

solved JAVA string how can i implement the length method