Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ejercicio2;
- import java.util.*;
- public class Ejercicio2 {
- public static boolean hayNombreCorto(CharSequence[] a) {
- boolean encontrado = false;
- int i = 0;
- while (!encontrado && i < a.length) {
- if (a[i].length() < 6) {
- encontrado = true;
- } else {
- i++;
- }
- }
- return encontrado;
- }
- public static void modificarSb(CharSequence[] a) {
- for (CharSequence cs : a) {
- if (cs instanceof StringBuilder) {
- ((StringBuilder)cs).append("/sb");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement