>>639

直接文字列はなげられないけど
例外クラスってのがあってそれに持たせることができるよ

public class Poi{
  
  public static void main(){
    String err_msg = "";
    try{
      err_msg="err";
      throw new Exception(err_msg);
    }catch(Exception e) {
      e.getMessage();
    }
  }
  
}