Last active
July 30, 2017 13:27
Revisions
-
Yuma Soga revised this gist
Jul 30, 2017 . 3 changed files with 26 additions and 15 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,13 @@ package cl1; import cl2; //こっちは報告用にちょっと直しただけ。デバッグさえしてない。 public class class1 implements OBJInterface{ public static void main(String[] args) { ObjectManager.addScript(new MainCode()); } public static void start(){ System.out.println("成功!2"); } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,15 @@ package cl2; import java.util.ArrayList; //こういう風にやって解決(デバッグが通っただけでまだ動作は試してない。) public class ObjectManager { public ArrayList<OBJInterface> objects = new ArrayList<OBJInterface>(); public void addScript(OBJInterface obj){ objects.add(obj); } public void runStart(){//こいつをどっかで呼ぶ。 for(OBJInterface o :objects){ o.start(); } } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ package cl3; public interface OBJInterface { void Start(); void Update(); } -
Yuma Soga created this gist
Jul 29, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ package cl1; public class class1{ public static void start(){ System.out.println("成功!2"); } } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ package cl2; public class class2{ public static void main(String[] args){ //cl1.class1.start(); //cl1.class1.start(); を実行したい。(ひとつの命令で。) //ただ、クラス名、パッケージ名がわからない。 //Scratchで言う、メッセージを送るみたいな感じで実行したい。 } } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ package cl3; public class class3{ public static void start(){ System.out.println("成功!:3"); } }