Ciao a tutti... ho un piccolo problemino (oggi ne ho avuti fin troppi XD su questo forum)
ho creato una mia eccezione
che lancio qui:codice:public class MalformedTagException extends Exception{ public MalformedTagException(String message){ super(message); } }
ma in compilazione mi viene restituito questo errore:codice:import java.util.*; public class Tag{ private String tagName; private Hashtable<String, String> attributes; private int isOpen; //0 = apertura; 1 = chiusura; 2 = entrambe. public Tag(String s) throws MalformedTagException{ if(!s.matches("[a-zA-Z1-6]+( +[a-zA-Z]+ ?= ?\"[a-zA-Z0-9]*\")*")) throw MalformedTagException("Sbagliato"); // controllo che il tag sia nel formato giusto
Le due classi sono su file diversi ma posti nella stessa cartella.codice:Tag.java:9: cannot find symbol symbol : method MalformedTagException(java.lang.String) location: class Tag if(!s.matches("[a-zA-Z1-6]+( +[a-zA-Z]+ ?= ?\"[a-zA-Z0-9]*\")*")) throw MalformedTagException("Sbagliato"); // controllo che il tag sia nel formato giusto ^ 1 error
Cosa posso fare per risolvere questo errore?

Rispondi quotando