Here i need to write this code for class and i am getting the missing return statement error. Heres my code :
import java.util.Scanner;
import java.text.DecimalFormat;
public class derived extends Foreign
{
Scanner keyboard = new Scanner(System.in);
private String date;
public void vertDisplay()
{
super.vertDisplay();
System.out.println("Date = " + date);
}
public double inputDollars()
{
super.inputDollars();
System.out.println("Please enter todays date. 00.00.00");
date = keyboard.nextLine();
}
}
Im not sure why it is doing this but if i delete the last part and make it like this...
import java.util.Scanner;
import java.text.DecimalFormat;
public class derived extends Foreign
{
Scanner keyboard = new Scanner(System.in);
private String date;
public void vertDisplay()
{
super.vertDisplay();
System.out.println("Date = " + date);
}
}
then it works fine. Could someone please help me