Skip to content

Instantly share code, notes, and snippets.

@yum45f
Last active July 30, 2017 13:27
Show Gist options
  • Save yum45f/8fc767ac1b24df76a3b65bed5fab6b51 to your computer and use it in GitHub Desktop.
Save yum45f/8fc767ac1b24df76a3b65bed5fab6b51 to your computer and use it in GitHub Desktop.
パッケージ名がわからないクラスにあるメソッドを呼び出すプログラム。(一部抜粋)
package cl1;
public class class1{
public static void start(){
System.out.println("成功!2");
}
}
package cl2;
public class class2{
public static void main(String[] args){
//cl1.class1.start();
//cl1.class1.start(); を実行したい。(ひとつの命令で。)
//ただ、クラス名、パッケージ名がわからない。
//Scratchで言う、メッセージを送るみたいな感じで実行したい。
}
}
package cl3;
public class class3{
public static void start(){
System.out.println("成功!:3");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment