Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Apexとインターフェイスクラス
public interface InterfaceSample {
String sampleMethod1();
String sampleMethod2(Integer num);
}
public with sharing class ImplementsSample implements InterfaceSample {
public String sampleMethod1() {
return 'サンプル1';
}
public String sampleMethod2(Integer num) {
return 'サンプル2 : ' + String.valueOf(num);
}
}
public with sharing class InterfaceSampleRun {
/**
* コンストラクタ
*/
public InterfaceSampleRun() {
ImplementsSample sample = new ImplementsSample();
String result1 = sample.sampleMethod1();
String result2 = sample.sampleMethod2(1000);
System.debug(result1);
System.debug(result2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.