基本上我对java非常陌生,我在硬核方面苦苦挣扎,我已经走到这一步了
public class Song {
//Instance field
private String Maker;
private String Name;
private int Length;
private String Type;
private int yearReleased;
//0 Arg
public Song() {
Maker = "Logic";
Name = "1-800";
Length = 4;
Type = "Hip Hop";
yearReleased = 2017;
}
//Multi Arg
public Song(String Maker, String Name, int Length, String Type) {
this.Maker = Maker;
this.Name = Name;
this.Length = Length;
this.Type = Type;
this.yearReleased = yearReleased;
}
public String getyearReleased() {
return Song;
}
public void setName(string name) {
this.yearReleased = yearReleased;
}
public String getyearReleased() {
return yearReleased;
}
//Method
public String toString() {
String output;
output = "The artist of this song is " + Maker + "\n" +
"The name of this song is called " + Name + "\n" +
"This song is " + Length + " Minutes long" + "\n" +
"The genre of this song is " + Type;
return output;
}
}
我已经做好了司机。是的,这会出现错误,我还需要添加,convertMinToSec()但是发生了什么?我如何正确设置 getters setters 并将其转换为分钟秒?
你知道,当你的老师从 2+2 开始时,你看向别处,再回头看,他们的分数是 2>(2+2)^8 = x/5*3ve+32% 是的,我会将这个与那个进行比较。
有人请帮助我告诉我如何正确设置 getter setter 并将分钟转换为秒。我已经尝试过正确设置但惨败。
我的预期结果是它能够正确回忆输出和发布的年份,但它不会因为说出不正确的符号而出错,这是我第一次发帖,所以我知道这看起来绝对愚蠢,但对我来说它不是,我在网上查了一下,找不到这方面的好内容,我就靠你们在我不知道的时候给像我这样的菜鸟指点迷津了!如果您回答的话,感谢您抽出宝贵的时间来回答。
温温酱
慕丝7291255
白衣非少年
相关分类