Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/05/2016, 16:33
Avatar de leo_search1
leo_search1
 
Fecha de Ingreso: octubre-2011
Mensajes: 100
Antigüedad: 12 años, 6 meses
Puntos: 1
Pregunta Error: cannot find symbol (JAVA)

No sè el por què me da error al compilar el siguiente codigo.

public class HelloWorld{

public static void main(String []args){
Pattern pattern = Pattern.compile("here");
Matcher matcher = pattern.matcher("input here");

while (matcher.find()) {
System.out.println(matcher.group());
}
}
}


ERROR

^
symbol: class Pattern
location: class HelloWorld
HelloWorld.java:4: error: cannot find symbol
Pattern pattern = Pattern.compile("here");
^
symbol: variable Pattern
location: class HelloWorld
HelloWorld.java:5: error: cannot find symbol
Matcher matcher = pattern.matcher("input here");
^
symbol: class Matcher
location: class HelloWorld
3 errors
sh-4.3$ ^C

A que se debe el error?

Gracias.