Im essayant d'obtenir de l'aide pour exécuter avec mon compilateur automobile je chaned quelques choses et j'ai 1 erreurEssayer de mettre en œuvre une classe
public class AutomobileDescription
{
/**
Constructor to display the make, model and price the new automobile I wish to purchase
*/
public AutomobileDescription(String carMake, String carModel, carPrice)
{
make = m;
model = mo;
price = p;
}
public String m =("Toyota");
public String mo =("Camry");
public String p =("22055");
public String getAutomobileinfo()
{
return m + mo + p;
Automobile myAutomobile = new Automobile(Toyota, Camry, 22055);
System.out.println("The Make, Model and Price of the car is: m + mo + p ");
}
}
---- jGRASP exec: javac -g AutomobileDescription.java
AutomobileDescription.java:7: error: attendu AutomobileDescription publique (String carMake, String carModel, carPrice) ^ 1 erreur
---- jGRASP wedge2: code de sortie fo Le processus r est 1. ---- jGRASP: opération terminée.
Avez-vous un problème? – SLaks
Les méthodes sont supposées avoir des noms, qui ne peuvent contenir que des lettres, des chiffres ou des traits de soulignement. – SLaks
En outre, vous devez fournir l'implémentation 'getMake',' getModel' et 'getPrice'. – Vulcan