Jump to content

Arrays


JSimoes

Recommended Posts

Tens de o fazer manualmente pelo menos eu não de nenhuma actualização sobre isso.

Vais ter de criar uma copia de cada uma das posições originais e colocar no novo array.

Tens sempre a opção do Vector que é muito bom 🙂

http://java.sun.com/javase/6/docs/api/java/util/Vector.html

I haven’t lost my mind; it’s backed up on DVD somewhere!

Link to comment
Share on other sites

não percebi a ideia :S

Explica lá isso melhor.

A ideia era pegar numa string e verificar se uma outra string de um array existe na primeira e depois fazer um print até á string que verifica a condição.

Algo como isto:

]
public class Decompor
{

static String[] chars = { "k", "w", "y"};

static String string = "";

static int i=0; static int j=0;

public static void decompoeString(String string)
{

	for(i=0; i<chars.length; i++)
	{
		if(string.contains(chars[i]))
		{
			for(j=0; j<chars[i]; j++) {}
				System.out.print(string.charAt(i) + " ");
		}	

	}

}

public static void main(String[] args)
{

	string = args[0];

	decompoeString(string);

}

}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.