create java string lingth 6 code example Example: java check for string length String data = "Hello, World!"; int nameLength = data.length(); // 13