宜しくお願い致します。
1)エディタ:Atom
2)エラー内容:
Sample2.java:5: エラー: シンボルを見つけられません
Day birthDay = new Day();
^
シンボル: クラス Day
場所: クラス Sample2
Sample2.java:5: エラー: シンボルを見つけられません
Day birthDay = new Day();
^
シンボル: クラス Day
場所: クラス Sample2
エラー2個
3)コード:
public class Sample2 {
public static void main(String[] args) { Day birthDay = new Day(); birthDay.year = 1975; birthDay.month = 11; birthDay.day = 16; System.out.println(birthDay.toFormatString()); }
}
public class Day {
int year;
int month;
int day;
String toFormatString() { return year + "年" + month + "月" + day + "日"; }
よろしくお願い申し上げます。
回答1件
あなたの回答
tips
プレビュー