How do I fix this error?
java.util.NoSuchElementException: No line found.
I looked at other similar posts but couldn't figure out what to do with the solution. It looks (to me) like every sc.nextLine(); had a corresponding line with it.
Important Code is below Sorry, for the bad fromatting/Understanding. Its my first time here and I just started getting into programming.
package assignment2;
import java.util.Scanner;
public class StringToolsTester {
public static void main(String[] args) {
StringTools obj = new StringTools();
//Method to get the reverse of the users string input
Scanner s = new Scanner(System.in);
System.out.print("reverse - Enter Any String: ");
String z = s.nextLine();
System.out.println("Reversed String: "+obj.reverse(z));
s.close();
//Method to get initials of the users string input
Scanner a = new Scanner(System.in);
System.out.print("initials - Enter Full Name: ");
String initial = a.nextLine();
System.out.println("Initials: "+obj.initials(initial));
a.close();
//Method to get the most frequent character from the users string input
Scanner b = new Scanner(System.in);
System.out.print("mostFrequent - Enter String: ");
String most = b.nextLine();
System.out.println("Most frequent character = "+obj.mostFrequent(most));
b.close();
//Method to get the binary equivalent of the users binary string input
Scanner c = new Scanner(System.in);
System.out.print("binaryToDecimal - Enter Binary: ");
String str = c.nextLine();
System.out.println(StringTools.binaryToDecimal(str));
c.close();