Erro quando compilo

C:\java\qweqwe.java:9: cannot resolve symbol
symbol : variable lenght
location: class java.lang.String[]
int oneLenght = wordlistone.lenght;
^
C:\java\qweqwe.java:10: cannot resolve symbol
symbol : variable lenght
location: class java.lang.String[]
int twoLenght = wordlisttwo.lenght;
^
C:\java\qweqwe.java:11: cannot resolve symbol
symbol : variable lenght
location: class java.lang.String[]
int threeLenght = wordlistthree.lenght;
^
3 errors

Process completed.

[code]public class phraseomatic
{
public static void main (String args[])
{
String[] wordlistone = {“julio”,“andersonnnn”,“coelho”};
String[] wordlisttwo = {“anderson”,“oliveira”,“cachorro”};
String[] wordlistthree = {“roxo”,“ronaldo”,“zanata”};

	int oneLenght = wordlistone.lenght;
	int twoLenght = wordlisttwo.lenght;
	int threeLenght = wordlistthree.lenght;
	
	int rand1 = (int) (Math.random() * oneLenght);
	int rand2 = (int) (Math.random() * twoLenght);
	int rand3 = (int) (Math.random() * threeLenght);
	
	String phrase = wordlistone[rand1] + "" + wordlisttwo[rand2] + "" + wordlistthree[rand3];
	System.out.println("Precisamos de"+ phrase);
}

}[/code]

Amigo,

Troca wordlistone.lenght por wordlistone.length, e nos demais array também.

Arthur

[quote=faicoxim]C:\java\qweqwe.java:9: cannot resolve symbol
symbol : variable lenght
location: class java.lang.String[]
int oneLenght = wordlistone.lenght;
^
C:\java\qweqwe.java:10: cannot resolve symbol
symbol : variable lenght
location: class java.lang.String[]
int twoLenght = wordlisttwo.lenght;
^
C:\java\qweqwe.java:11: cannot resolve symbol
symbol : variable lenght
location: class java.lang.String[]
int threeLenght = wordlistthree.lenght;
^
3 errors

Process completed.

[code]public class phraseomatic
{
public static void main (String args[])
{
String[] wordlistone = {“julio”,“andersonnnn”,“coelho”};
String[] wordlisttwo = {“anderson”,“oliveira”,“cachorro”};
String[] wordlistthree = {“roxo”,“ronaldo”,“zanata”};

	int oneLenght = wordlistone.lenght;
	int twoLenght = wordlisttwo.lenght;
	int threeLenght = wordlistthree.lenght;
	
	int rand1 = (int) (Math.random() * oneLenght);
	int rand2 = (int) (Math.random() * twoLenght);
	int rand3 = (int) (Math.random() * threeLenght);
	
	String phrase = wordlistone[rand1] + "" + wordlisttwo[rand2] + "" + wordlistthree[rand3];
	System.out.println("Precisamos de"+ phrase);
}

}[/code][/quote]

Por que você num utiliza um IDE (eclipse ou netbeans) vai te ajudar bastante.

[quote=agcn84][quote=faicoxim]C:\java\qweqwe.java:9: cannot resolve symbol
symbol : variable lenght
location: class java.lang.String[]
int oneLenght = wordlistone.lenght;
^
C:\java\qweqwe.java:10: cannot resolve symbol
symbol : variable lenght
location: class java.lang.String[]
int twoLenght = wordlisttwo.lenght;
^
C:\java\qweqwe.java:11: cannot resolve symbol
symbol : variable lenght
location: class java.lang.String[]
int threeLenght = wordlistthree.lenght;
^
3 errors

Process completed.

[code]public class phraseomatic
{
public static void main (String args[])
{
String[] wordlistone = {“julio”,“andersonnnn”,“coelho”};
String[] wordlisttwo = {“anderson”,“oliveira”,“cachorro”};
String[] wordlistthree = {“roxo”,“ronaldo”,“zanata”};

	int oneLenght = wordlistone.lenght;
	int twoLenght = wordlisttwo.lenght;
	int threeLenght = wordlistthree.lenght;
	
	int rand1 = (int) (Math.random() * oneLenght);
	int rand2 = (int) (Math.random() * twoLenght);
	int rand3 = (int) (Math.random() * threeLenght);
	
	String phrase = wordlistone[rand1] + "" + wordlisttwo[rand2] + "" + wordlistthree[rand3];
	System.out.println("Precisamos de"+ phrase);
}

}[/code][/quote]

Por que você num utiliza um IDE (eclipse ou netbeans) vai te ajudar bastante.[/quote]

Discordo, se o cara ta começando o melhor é ele não utilizar IDE, já tive esse mesmo problema uma vez trocando as letras “T” e “H”…

Concordo plenamente!!!

O uso de IDE’s para quem está iniciando o estudo da linguagem leva ao comodismo…
Bloco de notas nele!!! Vai aprender a fazer na unha, pra depois pegar as manhas de IDE’s… é bem melhor do que passar raiva vendo aquele tanto de classe e código que o NetBeans cria e você nem sabe pra que serve…

Notepad++: the best IDE!!!
hauhauhauahuahauhauah

Abraço,

Tiago Paulino

Aí pessoal muito obrigado, funcionou