Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner
import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Scanner; public abstract class Account1 { Scanner s=new Scanner(System.in); public String name=s.next(); public double bal=s.nextDouble(); static Date strDate; public static void main(String[] args) { Scanner s=new Scanner(System.in); System.out.println("Enter the type of account (1/2)"); int type=s.nextInt(); Savings sav=new Savings(); Current c=new Current(); if(type==1) System.out.println(sav.calculateInterest(strDate)); else if(type==2) System.out.println(c.calculateInterest(strDate)); else System.out.println("Invalid request"); } abstract double calculateInterest(Date strDate); } class Savings extends Account1{ Savings sav=new Savings(); Scanner s=new Scanner(System.in); int Irate=12; //System.out.println("enter start date"); String date1=s.next(); //System.out.println("enter end date"); String date2=s.next(); double calculateInterest(Date strDate){ DateFormat d=new SimpleDateFormat("dd/mm/yyyy"); System.out.println("enter start date"); String date1=s.next(); System.out.println("enter end date"); String date2=s.next(); try { strDate=d.parse(date1); } catch (ParseException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } Date endDate = null; try { endDate = d.parse(date2); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } double rate=(strDate.getTime()-endDate.getTime())/84600000; int intrate=(int)Math.abs(rate); double Interest=(bal*intrate*Irate)/100; return Interest; } } class Current extends Account1{ Current c=new Current(); Scanner s=new Scanner(System.in); int Irate=5; double calculateInterest(Date strDate){ DateFormat d=new SimpleDateFormat("dd/mm/yyyy"); System.out.println("enter start date"); String date1=s.next(); System.out.println("enter end da