Added New Classes
BAEL-4193 NoSuchMethodError
This commit is contained in:
parent
e7ec3ff7bc
commit
5db4e332b9
@ -0,0 +1,20 @@
|
|||||||
|
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 StringJoiner getSpecials() {
|
||||||
|
StringJoiner specials = new StringJoiner(", ");
|
||||||
|
try {
|
||||||
|
specials.add(SpecialToday.getStarter());
|
||||||
|
specials.add(SpecialToday.getDesert());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return specials;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.baeldung.exceptions.nosuchmethoderror;
|
||||||
|
|
||||||
|
public class SpecialToday {
|
||||||
|
private static String desert = "Chocolate Cake";
|
||||||
|
private static String starter = "Caesar Salad";
|
||||||
|
|
||||||
|
public static String getDesert() {
|
||||||
|
return desert;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getStarter() {
|
||||||
|
return starter;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user