I have both filenames (IDiscount and Loan) in a directory called certification.
This code works and compiles fine in eclipse but when I try and run from command line using notepad I get the error
Loan.java:2: error: '.' expected
import IDiscount;
^
1 error
IDiscount.java file:
package certification;
public interface IDiscount {
void calculateDiscountedBillAmount(double billAmount, int discount);
}
Loan.java file:
package certification;
import IDiscount;
public class Loan implements IDiscount {
private int customerId;
private int billId;
private int discount;
private double billAmount;
private double discountedBillAmount;
public Loan(int customerId, int billId, int discount, double billAmount)
{
this.customerId = customerId;
this.billId = billId;
this.discount = discount;
this.billAmount = billAmount;
}
public void calculateDiscountedBillAmount(double billAmount, int discount)
{
System.out.println("Hello World");
}
public static void main(String[] args){
Loan privateLoan = new Loan(101,1001,2,199.99);
privateLoan.calculateDiscountedBillAmount(199.99,2);
}
}
It works fine in eclipse but I am trying to get better by using command line and notepad only but the Loan file will not compile. I have narrowed the problem down to an issue with my import statement. I have tried import IDiscount.calculateDiscountedBillAmount; as well and that does not work either. Any thoughts?