Java:je n'arrive pas executer mon prg
Résolu
domxaline
-
domxaline -
domxaline -
Bonjour,
en executant mon prg,j'ai une boite à message apparait en disant
"fatal exception occured program will exit" OK
et encore erreur aussi
java.lang.NoSuchMethodError: main
Exception in thread "main"
main souligné
en pointant avec le curseur de souris m'indique
"void is an unvalid type for the variable main"
) après ce parenthèse souligné aussi
syntax error on token ")" ,; expected
en executant mon prg,j'ai une boite à message apparait en disant
"fatal exception occured program will exit" OK
et encore erreur aussi
java.lang.NoSuchMethodError: main
Exception in thread "main"
import java.lang.annotation.*;
import java.lang.reflect.*;
@Retention(RetentionPolicy.RUNTIME)
@interface MySingle
{
int value( );//this variable name must be value
}
public class Single
{
//annotate a method using a marker
@MySingle(100)
public static void myMeth( )
{
Single ob=new Single ();
try
{
Method m=ob.getClass().getMethod("myMeth");
MySingle anno=m.getAnnotation(MySingle.class);
System.out.println("This value is:"+anno.value());
//displays 100
}
catch(NoSuchMethodException exc)
{
System.out.println("Method not found.");
}
public static void main(String[]args)
{
myMeth();
}
}
}
public static void main(String[]args)
main souligné
en pointant avec le curseur de souris m'indique
"void is an unvalid type for the variable main"
) après ce parenthèse souligné aussi
syntax error on token ")" ,; expected
A voir également:
- Java:je n'arrive pas executer mon prg
- Jeux java itel - Télécharger - Jeux vidéo
- Waptrick java football - Télécharger - Jeux vidéo
- Eclipse java - Télécharger - Langages
- Waptrick java voiture - Télécharger - Jeux vidéo
- Java apk - Télécharger - Langages