This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void function sendEmailMessages(string emailTemplate) | |
| { | |
| var msg = ""; | |
| var mailer = new Mail(); | |
| var totalPointCount = 0; | |
| mailer.setSubject("Thank you for your recent purchase"); | |
| mailer.setFrom("[email protected]"); | |
| var userQuery = new Query(); | |
| userQuery.setDataSource("depot"); | |
| userQuery.setSql("select * from EmailList where Category = 5"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Plant rex = new VenusFlyTrap(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BugEaterCollection | |
| { | |
| public void addBugEater(BugEater bugEater) | |
| { | |
| // code goes here | |
| } | |
| } | |
| // Calling code can do this: | |
| addBugEater(new VenusFlyTrap()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface BugEater | |
| { | |
| void consume(Bug bug); | |
| } | |
| class Aardvark : BugEater | |
| { | |
| public void consume(Bug bug) | |
| { | |
| // code goes here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface ISwitch | |
| { | |
| void turnOn(); | |
| void turnOff(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LightSwitch | |
| { | |
| // PUBLIC STUFF PRIVATE STUFF | |
| // ---------------------------- ------------------------------------------------ | |
| private Wire inboundWire, outboundWire; | |
| private bool isOn; | |
| public void turnOn() | |
| { | |
| connectWires(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ISwitch myLightSwitch = new LightSwitch(wire1, wire2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LightSwitch : ISwitch | |
| { | |
| // Omitting contents for brevity... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| <!--- IAccount.cfc ---> | |
| interface | |
| { | |
| public numeric function getBalance(); | |
| } | |
| <!--- CheckingAccount.cfc ---> | |
| component implements="IAccount" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface IAccount | |
| { | |
| decimal GetBalance(); | |
| } | |
| class CheckingAccount : IAccount | |
| { | |
| public decimal GetBalance() | |
| { | |
| return 0; |
NewerOlder