A voir également:
- Cannot be resolved to a type java
- Youtube to mp4 conconventer - Forum Vidéo/TV
- Cam to cam - Forum Internet / Réseaux sociaux
- Cannot access offset of type string on string - Forum PHP
- Qwerty to azerty - Guide
- Cannot be resolved to a variable ✓ - Forum Programmation
3 réponses
j'ai corrigé ainsi
maintenant j'ai erreur suivante:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method getmessage() is undefined for the type MyException
at Excep3.main(Excep3.java:24)
import java.lang.*;
class MyException extends Exception
{
MyException(String message)
{
super(message);
}
}
public class Excep3
{
public static void main (String args[])
{
if(args[0]=="hello")
System.out.println("String is right");
else
try
{
throw new MyException("invalid String");
}
catch(MyException ex)
{
System.out.println(ex.getmessage());
}
}
}
maintenant j'ai erreur suivante:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method getmessage() is undefined for the type MyException
at Excep3.main(Excep3.java:24)
18 sept. 2012 à 10:14
Ah, les exceptions, on peut en écrire des bouquins.
1. C'est crapouillaud de tout mettre au même endroit. Créée une classe MyException à part.
2. Ton code est opérationnel, tu dois avoir un problème de path. Chez moi, ca compile et ça s'execute.
18 sept. 2012 à 14:06
Je ne vois pas le problème ! Si encore ça avait été une inner classe... mais ce n'est pas le cas !
"2. Ton code est opérationnel, tu dois avoir un problème de path."
Si tu ne dis pas à domxaline qu'il faut mettre un M majuscule à getMessage, il va lui falloir 2h pour trouver !