0
Error: Could not find or load main class Dcoder
solution
14 ответов
+ 3
Which ide do you use (or do you start your .class file from command line interface... or do you use playground here)? Have you been able to run something simple like "Hello world"?
+ 3
Try to change parameters of main from "(String name[])" to classic "(String[] args)" (I don't think it's the problem... but who knows, but it looks more like classpath problem, may be because of ide configuration)
+ 3
...else you can run java with an other classpath given by command line parameter, but it is not recommended (better to follow conventions)
+ 2
Yep. If topicstarter trying to run this code in SL's playground it would output "...not found... Dcoder" because of "package ..." But if this error is from Eclipse/IDEA/NetBeans/CLI/any_other_local_environment then it is another case.
+ 1
You should tag the language and post your code to help us, so that we can help you !
+ 1
I commented the "package" line, added public before the class keyword and it worked (not sure if public can be omitted or not though)
+ 1
Sorry, I did not understand what you said :/
0
pls help me
0
package user_inputs;
import java.util.Scanner;
class Dcoder{
public static void main(String name[])
{
Scanner cni = new Scanner(System.in);
String nom;
String prenom;
String travail;
int age;
try
{
System.out.println("entrer le nom:");
nom= cni.nextLine();
System.out.println("entrer le prenom:");
prenom=cni.nextLine();
System.out.println("entrer le travail:");
travail= cni.nextLine();
System.out.println("entrer l'age:");
age=cni.nextInt();
}
catch (Exception e){
System.out.print(e.toString());}
finally{ cni.close();}
}
}
0
not work i do but anything change the same problem
0
the same probleme