Ich arbeite an einem Projekt namens mycatmychoice, die ausgeführt wird, aber nicht angezeigt wird. Ich weiß, dass ich etwas vermisse, aber nicht sicher was. Jeder Rat wird sehr geschätzt. Dies ist ein kleiner Teil eines größeren Projekts, aber ich muss dieses Stück zuerst arbeiten lassen. Ich erhalte keine Fehler, aber die Ausgabe wird nicht angezeigt.Projekt läuft, aber nicht angezeigt
package mycatmychoice;
public final class Mycatmychoice {
public static void main(String[] args) {
}
//variables
private String name;
private String breed;
private String gender;
private String color;
private int age;
public String introducecat;
//constructor
public Mycatmychoice(String breed, String name, String gender, String color, int age) {
this.breed = breed;
this.breed = name;
this.gender = gender;
this.color = color;
this.age = age;
}
//Returns the value of name
public String getname() {
return name;
}
//Sets the name variable.
public void setname(String name) {
this.name = name;
}
//Returns the value of breed
public String getbreed() {
return breed;
}
//Sets the breed variable.
public void setbreed(String breed) {
this.breed = breed;
}
//Returns the value of gender
public String getgender() {
return gender;
}
//Sets the gender variable.
public void setgender(String gender) {
this.gender = gender;
}
//Returns the value of color
public String getcolor() {
return color;
}
//Sets the color variable.
public void setcolor(String color) {
this.color = color;
}
//Returns the value of age
public int getage() {
return age;
}
//Sets the age variable.
public void setage(int age) {
this.age = age;
}
public void introducecat() {
System.out.printf("Say hi to %s who is a %d year old %s %s %s cat \n", getname(), getage(), getgender(), getcolor(), getbreed());
}
}
Sie benötigen einige Anweisungen in der Hauptmethode. – laune
welche Art von Aussagen? Ich bin ein Anfänger. – Shelly