Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
23
Task/Abstract-type/Apex/abstract-type.apex
Normal file
23
Task/Abstract-type/Apex/abstract-type.apex
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Interface
|
||||
public interface PurchaseOrder {
|
||||
// All other functionality excluded
|
||||
Double discount();
|
||||
}
|
||||
|
||||
// One implementation of the interface for customers
|
||||
public class CustomerPurchaseOrder implements PurchaseOrder {
|
||||
public Double discount() {
|
||||
return .05; // Flat 5% discount
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Abstract Class
|
||||
public abstract class AbstractExampleClass {
|
||||
protected abstract Integer abstractMethod();
|
||||
}
|
||||
|
||||
// Complete the abstract class by implementing its abstract method
|
||||
public class Class1 extends AbstractExampleClass {
|
||||
public override Integer abstractMethod() { return 5; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue