For some reason the scanner seems to not be able to fine either nextLine() or next() and I don't know how to get it to work properly. If anyone could help this is the code so far
Class1
public static void main(String[] {
usingStrings.testRun();
}
Class2
public static void testRun() {
try {
String input;
System.out.println("Please enter your file name: ");
input = scan.next();
if (input.contains("e")) {
System.out.println(true);
} else {
System.out.println(false);
}
if (input.contains(".jpg")) {
System.out.println(true);
} else {
System.out.println(false);
}
if (input.contains("P")) {
System.out.println(true);
} else {
System.out.println(false);
}
scan.close();
} catch (NoSuchElementException e) {
System.err.println("No Such element exception");
};
}
}