function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jeremy_rossjeremy_ross 

No compile error when class doesn't completely implement an interface

Should I be getting compile errors on a class that doesn't implement all the methods that are specified in an interface that it implements?  I'm not.  Is this a run-time only check?

Jeremy
David VPDavid VP
I just ran this in the System Log window and it did complain about the interface method not being implemented :

Code:
    // An interface that defines what a purchase order looks like in general
    public interface PurchaseOrder {
        // All other functionality excluded
        Double discount();
    }
 
    // One implementation of the interface for customers
    public class CustomerPurchaseOrder implements PurchaseOrder {
        
    }

 
So I guess you should be getting compile errors ?



David