BAEL-4193 (updated files)

- removed not needed fields
This commit is contained in:
Rutuja Joshi 2020-08-12 07:24:44 +05:30 committed by GitHub
parent 4c4cafde1e
commit ea9c64147b
2 changed files with 10 additions and 25 deletions

View File

@ -1,20 +1,11 @@
package com.baeldung.exceptions.nosuchmethoderror;
import java.util.StringJoiner;
public class MainMenu {
public static void main(String[] args) {
System.out.println("Today's Specials: " + getSpecials());
}
public static void main(String[] args) {
System.out.println("Today's Specials: " + getSpecials());
}
public static StringJoiner getSpecials() {
StringJoiner specials = new StringJoiner(", ");
try {
specials.add(SpecialToday.getStarter());
specials.add(SpecialToday.getDesert());
} catch (Exception e) {
e.printStackTrace();
}
return specials;
}
public static String getSpecials() {
return SpecialToday.getDesert();
}
}

View File

@ -1,14 +1,8 @@
package com.baeldung.exceptions.nosuchmethoderror;
public class SpecialToday {
private static String desert = "Chocolate Cake";
private static String starter = "Caesar Salad";
private static String desert = "Chocolate Cake";
public static String getDesert() {
return desert;
}
public static String getStarter() {
return starter;
}
public static String getDesert() {
return desert;
}
}